diff --git a/make/StaticLibs.gmk b/make/StaticLibs.gmk index cfca2a774113d..d54c67b50b3ea 100644 --- a/make/StaticLibs.gmk +++ b/make/StaticLibs.gmk @@ -98,10 +98,8 @@ EXTERNAL_LIBS := $(strip $(shell $(CAT) $(LIB_FLAGS_FILES) | \ ifeq ($(call isTargetOs, macosx), true) STATIC_LIBS := $(addprefix -force_load$(SPACE), $(STATIC_LIB_FILES)) - STANDARD_LIBS += -lstdc++ else ifeq ($(call isTargetOs, linux), true) STATIC_LIBS := -Wl,--export-dynamic -Wl,--whole-archive $(STATIC_LIB_FILES) -Wl,--no-whole-archive - STANDARD_LIBS := -l:libstdc++.a else ifeq ($(call isTargetOs, windows), true) STATIC_LIBS := $(addprefix -wholearchive:, $(STATIC_LIB_FILES)) else @@ -115,7 +113,8 @@ $(eval $(call SetupBuildLauncher, java, \ OPTIMIZATION := HIGH, \ STATIC_LAUNCHER := true, \ LDFLAGS := $(LDFLAGS_STATIC_JDK), \ - LIBS := $(STATIC_LIBS) $(EXTERNAL_LIBS) $(STANDARD_LIBS), \ + LIBS := $(STATIC_LIBS) $(EXTERNAL_LIBS), \ + LINK_TYPE := C++, \ OUTPUT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \ OBJECT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \ )) diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index f78ccfe376214..259315bb23c01 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -640,23 +640,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], # Linking is different on macOS JVM_PICFLAG="" fi - - # Extra flags needed when building optional static versions of certain - # JDK libraries. - STATIC_LIBS_CFLAGS="-DSTATIC_BUILD=1" - if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then - STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections \ - -DJNIEXPORT='__attribute__((visibility(\"default\")))'" - else - STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -DJNIEXPORT=" - fi - if test "x$TOOLCHAIN_TYPE" = xgcc; then - # Disable relax-relocation to enable compatibility with older linkers - RELAX_RELOCATIONS_FLAG="-Xassembler -mrelax-relocations=no" - FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${RELAX_RELOCATIONS_FLAG}], - IF_TRUE: [STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS ${RELAX_RELOCATIONS_FLAG}"]) - fi - AC_SUBST(STATIC_LIBS_CFLAGS) ]) ################################################################################ diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index 18770c6d36031..2637285334bae 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -429,8 +429,6 @@ LIBFFI_LIB_FILE := @LIBFFI_LIB_FILE@ FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@ REPRODUCIBLE_CFLAGS := @REPRODUCIBLE_CFLAGS@ -STATIC_LIBS_CFLAGS := @STATIC_LIBS_CFLAGS@ - JMH_CORE_JAR := @JMH_CORE_JAR@ JMH_GENERATOR_JAR := @JMH_GENERATOR_JAR@ JMH_JOPT_SIMPLE_JAR := @JMH_JOPT_SIMPLE_JAR@ diff --git a/make/common/modules/LauncherCommon.gmk b/make/common/modules/LauncherCommon.gmk index 98e110a0a86cf..38485283dcb98 100644 --- a/make/common/modules/LauncherCommon.gmk +++ b/make/common/modules/LauncherCommon.gmk @@ -160,6 +160,7 @@ define SetupBuildLauncherBody -framework ApplicationServices \ -framework Cocoa \ -framework Security, \ + LINK_TYPE := $$($1_LINK_TYPE), \ OUTPUT_DIR := $$($1_OUTPUT_DIR), \ OBJECT_DIR := $$($1_OBJECT_DIR), \ VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \ diff --git a/make/common/native/Flags.gmk b/make/common/native/Flags.gmk index 213312047a4ff..daa9a83d62b2d 100644 --- a/make/common/native/Flags.gmk +++ b/make/common/native/Flags.gmk @@ -99,7 +99,7 @@ define SetupCompilerFlags $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release) endif ifeq ($(STATIC_LIBS), true) - $1_EXTRA_CFLAGS += $$(STATIC_LIBS_CFLAGS) + $1_EXTRA_CFLAGS += -DSTATIC_BUILD=1 endif # Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and/or TOOLCHAIN_TYPE diff --git a/src/demo/share/java2d/J2DBench/Makefile b/src/demo/share/java2d/J2DBench/Makefile index edc4494e131de..d9dd6258329b3 100644 --- a/src/demo/share/java2d/J2DBench/Makefile +++ b/src/demo/share/java2d/J2DBench/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/demo/share/java2d/J2DBench/build.xml b/src/demo/share/java2d/J2DBench/build.xml index 415c315899eac..2942e5fa2601b 100644 --- a/src/demo/share/java2d/J2DBench/build.xml +++ b/src/demo/share/java2d/J2DBench/build.xml @@ -1,5 +1,5 @@ * @see #lanewise(VectorOperators.Ternary,byte,byte,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,byte,VectorMask) @@ -2308,9 +2308,10 @@ ByteVector sliceTemplate(int origin, Vector v1) { ByteVector that = (ByteVector) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((byte)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + ByteVector iotaVector = (ByteVector) iotaShuffle().toBitsVector(); + ByteVector filter = broadcast((byte)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2338,9 +2339,10 @@ ByteVector slice(int origin, @ForceInline ByteVector sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((byte)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + ByteVector iotaVector = (ByteVector) iotaShuffle().toBitsVector(); + ByteVector filter = broadcast((byte)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2359,10 +2361,10 @@ ByteVector sliceTemplate(int origin) { ByteVector that = (ByteVector) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast((byte)(origin)))); - iota = iotaShuffle(-origin, 1, true); + ByteVector iotaVector = (ByteVector) iotaShuffle().toBitsVector(); + ByteVector filter = broadcast((byte)origin); + VectorMask blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2399,10 +2401,10 @@ ByteVector sliceTemplate(int origin) { ByteVector unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast((byte)(origin)))); - iota = iotaShuffle(-origin, 1, true); + ByteVector iotaVector = (ByteVector) iotaShuffle().toBitsVector(); + ByteVector filter = broadcast((byte)origin); + VectorMask blendMask = iotaVector.compare(VectorOperators.GE, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2425,13 +2427,11 @@ ByteVector sliceTemplate(int origin) { final > ByteVector rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, byte.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2454,13 +2454,11 @@ ByteVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, byte.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2481,30 +2479,29 @@ ByteVector rearrangeTemplate(Class shuffletype, S shuffle, ByteVector v) { VectorMask valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); ByteVector r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, byte.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); ByteVector r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, byte.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle toShuffle0(ByteSpecies dsp) { + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { + assert(dsp.length() == vspecies().length()); byte[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { @@ -2513,16 +2510,18 @@ VectorShuffle toShuffle0(ByteSpecies dsp) { return VectorShuffle.fromArray(dsp, sa, 0); } - /*package-private*/ @ForceInline - final - VectorShuffle toShuffleTemplate(Class shuffleType) { - ByteSpecies vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), byte.class, length(), - shuffleType, byte.class, length(), - this, vsp, - ByteVector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); + ByteVector idx = this; + ByteVector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + ByteVector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -4216,9 +4215,10 @@ static final class ByteSpecies extends AbstractSpecies { private ByteSpecies(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of(byte.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == Byte.SIZE); } @@ -4504,6 +4504,7 @@ static ByteSpecies species(VectorShape s) { = new ByteSpecies(VectorShape.S_64_BIT, Byte64Vector.class, Byte64Vector.Byte64Mask.class, + Byte64Vector.Byte64Shuffle.class, Byte64Vector::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -4511,6 +4512,7 @@ static ByteSpecies species(VectorShape s) { = new ByteSpecies(VectorShape.S_128_BIT, Byte128Vector.class, Byte128Vector.Byte128Mask.class, + Byte128Vector.Byte128Shuffle.class, Byte128Vector::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -4518,6 +4520,7 @@ static ByteSpecies species(VectorShape s) { = new ByteSpecies(VectorShape.S_256_BIT, Byte256Vector.class, Byte256Vector.Byte256Mask.class, + Byte256Vector.Byte256Shuffle.class, Byte256Vector::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -4525,6 +4528,7 @@ static ByteSpecies species(VectorShape s) { = new ByteSpecies(VectorShape.S_512_BIT, Byte512Vector.class, Byte512Vector.Byte512Mask.class, + Byte512Vector.Byte512Shuffle.class, Byte512Vector::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -4532,6 +4536,7 @@ static ByteSpecies species(VectorShape s) { = new ByteSpecies(VectorShape.S_Max_BIT, ByteMaxVector.class, ByteMaxVector.ByteMaxMask.class, + ByteMaxVector.ByteMaxShuffle.class, ByteMaxVector::new); /** diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java index 3760749264562..7d343d4e2447f 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java @@ -141,24 +141,15 @@ Double128Mask maskFromArray(boolean[] bits) { @ForceInline Double128Shuffle iotaShuffle() { return Double128Shuffle.IOTA; } + @Override @ForceInline Double128Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Double128Shuffle)VectorSupport.shuffleIota(ETYPE, Double128Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Double128Shuffle)VectorSupport.shuffleIota(ETYPE, Double128Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Double128Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double128Shuffle shuffleFromBytes(byte[] reorder) { return new Double128Shuffle(reorder); } - - @Override - @ForceInline - Double128Shuffle shuffleFromArray(int[] indexes, int i) { return new Double128Shuffle(indexes, i); } + Double128Shuffle shuffleFromArray(int[] indices, int i) { return new Double128Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Double128Shuffle.class); // specialize + public final Double128Shuffle toShuffle() { + return (Double128Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -780,25 +778,28 @@ static Double128Mask maskAll(boolean bit) { static final class Double128Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Double128Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Double128Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Double128Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Double128Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Double128Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Double128Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Double128Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public DoubleSpecies vspecies() { return VSPECIES; } @@ -806,47 +807,122 @@ public DoubleSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Double128Shuffle IOTA = new Double128Shuffle(IDENTITY); @Override @ForceInline public Double128Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Double128Shuffle.class, this, VLENGTH, - (s) -> ((Double128Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Double128Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long128Vector toBitsVector() { + return (Long128Vector) super.toBitsVectorTemplate(); + } + + @Override + Long128Vector toBitsVector0() { + return ((Long128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Double128Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Double128Shuffle.class, this, VLENGTH, - (s) -> ((Double128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + @Override - public Double128Shuffle rearrange(VectorShuffle shuffle) { - Double128Shuffle s = (Double128Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Double128Mask laneIsValid() { + return (Double128Mask) 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)) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Double128Shuffle wrapIndexes() { + Long128Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long128Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Double128Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Double128Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java index 2e31a80255091..a8645badc27fd 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java @@ -141,24 +141,15 @@ Double256Mask maskFromArray(boolean[] bits) { @ForceInline Double256Shuffle iotaShuffle() { return Double256Shuffle.IOTA; } + @Override @ForceInline Double256Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Double256Shuffle)VectorSupport.shuffleIota(ETYPE, Double256Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Double256Shuffle)VectorSupport.shuffleIota(ETYPE, Double256Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Double256Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double256Shuffle shuffleFromBytes(byte[] reorder) { return new Double256Shuffle(reorder); } - - @Override - @ForceInline - Double256Shuffle shuffleFromArray(int[] indexes, int i) { return new Double256Shuffle(indexes, i); } + Double256Shuffle shuffleFromArray(int[] indices, int i) { return new Double256Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Double256Shuffle.class); // specialize + public final Double256Shuffle toShuffle() { + return (Double256Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -784,25 +782,28 @@ static Double256Mask maskAll(boolean bit) { static final class Double256Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Double256Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Double256Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Double256Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Double256Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Double256Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Double256Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Double256Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public DoubleSpecies vspecies() { return VSPECIES; } @@ -810,47 +811,122 @@ public DoubleSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Double256Shuffle IOTA = new Double256Shuffle(IDENTITY); @Override @ForceInline public Double256Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Double256Shuffle.class, this, VLENGTH, - (s) -> ((Double256Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Double256Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long256Vector toBitsVector() { + return (Long256Vector) super.toBitsVectorTemplate(); + } + + @Override + Long256Vector toBitsVector0() { + return ((Long256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Double256Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Double256Shuffle.class, this, VLENGTH, - (s) -> ((Double256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + @Override - public Double256Shuffle rearrange(VectorShuffle shuffle) { - Double256Shuffle s = (Double256Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Double256Mask laneIsValid() { + return (Double256Mask) 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)) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Double256Shuffle wrapIndexes() { + Long256Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long256Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Double256Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Double256Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java index 6ed3dd7325c28..64535c67b1900 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java @@ -141,24 +141,15 @@ Double512Mask maskFromArray(boolean[] bits) { @ForceInline Double512Shuffle iotaShuffle() { return Double512Shuffle.IOTA; } + @Override @ForceInline Double512Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Double512Shuffle)VectorSupport.shuffleIota(ETYPE, Double512Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Double512Shuffle)VectorSupport.shuffleIota(ETYPE, Double512Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Double512Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double512Shuffle shuffleFromBytes(byte[] reorder) { return new Double512Shuffle(reorder); } - - @Override - @ForceInline - Double512Shuffle shuffleFromArray(int[] indexes, int i) { return new Double512Shuffle(indexes, i); } + Double512Shuffle shuffleFromArray(int[] indices, int i) { return new Double512Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Double512Shuffle.class); // specialize + public final Double512Shuffle toShuffle() { + return (Double512Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -792,25 +790,28 @@ static Double512Mask maskAll(boolean bit) { static final class Double512Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Double512Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Double512Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Double512Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Double512Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Double512Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Double512Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Double512Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public DoubleSpecies vspecies() { return VSPECIES; } @@ -818,47 +819,122 @@ public DoubleSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Double512Shuffle IOTA = new Double512Shuffle(IDENTITY); @Override @ForceInline public Double512Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Double512Shuffle.class, this, VLENGTH, - (s) -> ((Double512Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Double512Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long512Vector toBitsVector() { + return (Long512Vector) super.toBitsVectorTemplate(); + } + + @Override + Long512Vector toBitsVector0() { + return ((Long512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Double512Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Double512Shuffle.class, this, VLENGTH, - (s) -> ((Double512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + @Override - public Double512Shuffle rearrange(VectorShuffle shuffle) { - Double512Shuffle s = (Double512Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Double512Mask laneIsValid() { + return (Double512Mask) 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)) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Double512Shuffle wrapIndexes() { + Long512Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long512Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Double512Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Double512Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java index 2e1b21350012a..45b91ee88bf42 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java @@ -141,24 +141,15 @@ Double64Mask maskFromArray(boolean[] bits) { @ForceInline Double64Shuffle iotaShuffle() { return Double64Shuffle.IOTA; } + @Override @ForceInline Double64Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Double64Shuffle)VectorSupport.shuffleIota(ETYPE, Double64Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Double64Shuffle)VectorSupport.shuffleIota(ETYPE, Double64Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Double64Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double64Shuffle shuffleFromBytes(byte[] reorder) { return new Double64Shuffle(reorder); } - - @Override - @ForceInline - Double64Shuffle shuffleFromArray(int[] indexes, int i) { return new Double64Shuffle(indexes, i); } + Double64Shuffle shuffleFromArray(int[] indices, int i) { return new Double64Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Double64Shuffle.class); // specialize + public final Double64Shuffle toShuffle() { + return (Double64Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -778,25 +776,28 @@ static Double64Mask maskAll(boolean bit) { static final class Double64Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Double64Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Double64Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Double64Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Double64Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Double64Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Double64Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Double64Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public DoubleSpecies vspecies() { return VSPECIES; } @@ -804,47 +805,122 @@ public DoubleSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Double64Shuffle IOTA = new Double64Shuffle(IDENTITY); @Override @ForceInline public Double64Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Double64Shuffle.class, this, VLENGTH, - (s) -> ((Double64Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Double64Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long64Vector toBitsVector() { + return (Long64Vector) super.toBitsVectorTemplate(); + } + + @Override + Long64Vector toBitsVector0() { + return ((Long64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Double64Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Double64Shuffle.class, this, VLENGTH, - (s) -> ((Double64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + @Override - public Double64Shuffle rearrange(VectorShuffle shuffle) { - Double64Shuffle s = (Double64Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Double64Mask laneIsValid() { + return (Double64Mask) 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)) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Double64Shuffle wrapIndexes() { + Long64Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long64Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Double64Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Double64Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java index 8d69b6fcbc730..03f9448f1abf1 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java @@ -141,24 +141,15 @@ DoubleMaxMask maskFromArray(boolean[] bits) { @ForceInline DoubleMaxShuffle iotaShuffle() { return DoubleMaxShuffle.IOTA; } + @Override @ForceInline DoubleMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (DoubleMaxShuffle)VectorSupport.shuffleIota(ETYPE, DoubleMaxShuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (DoubleMaxShuffle)VectorSupport.shuffleIota(ETYPE, DoubleMaxShuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (DoubleMaxShuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - DoubleMaxShuffle shuffleFromBytes(byte[] reorder) { return new DoubleMaxShuffle(reorder); } - - @Override - @ForceInline - DoubleMaxShuffle shuffleFromArray(int[] indexes, int i) { return new DoubleMaxShuffle(indexes, i); } + DoubleMaxShuffle shuffleFromArray(int[] indices, int i) { return new DoubleMaxShuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(DoubleMaxShuffle.class); // specialize + public final DoubleMaxShuffle toShuffle() { + return (DoubleMaxShuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -777,25 +775,28 @@ static DoubleMaxMask maskAll(boolean bit) { static final class DoubleMaxShuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM + static final Class ETYPE = long.class; // used by the JVM - DoubleMaxShuffle(byte[] reorder) { - super(VLENGTH, reorder); + DoubleMaxShuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public DoubleMaxShuffle(int[] reorder) { - super(VLENGTH, reorder); + DoubleMaxShuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public DoubleMaxShuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + DoubleMaxShuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public DoubleMaxShuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public DoubleSpecies vspecies() { return VSPECIES; } @@ -803,47 +804,122 @@ public DoubleSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final DoubleMaxShuffle IOTA = new DoubleMaxShuffle(IDENTITY); @Override @ForceInline public DoubleMaxVector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, DoubleMaxShuffle.class, this, VLENGTH, - (s) -> ((DoubleMaxVector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (DoubleMaxVector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + LongMaxVector toBitsVector() { + return (LongMaxVector) super.toBitsVectorTemplate(); + } + + @Override + LongMaxVector toBitsVector0() { + return ((LongMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public DoubleMaxShuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, DoubleMaxShuffle.class, this, VLENGTH, - (s) -> ((DoubleMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + @Override - public DoubleMaxShuffle rearrange(VectorShuffle shuffle) { - DoubleMaxShuffle s = (DoubleMaxShuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final DoubleMaxMask laneIsValid() { + return (DoubleMaxMask) 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)) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final DoubleMaxShuffle wrapIndexes() { + LongMaxVector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (LongMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (LongMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (DoubleMaxShuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new DoubleMaxShuffle(r); + return true; } } 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 5b3a25baa58be..8065bf915a526 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 @@ -966,7 +966,7 @@ DoubleVector lanewise(VectorOperators.Binary op, // and broadcast, but it would be more surprising not to continue // the obvious pattern started by unary and binary. - /** + /** * {@inheritDoc} * @see #lanewise(VectorOperators.Ternary,double,double,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,double,VectorMask) @@ -2138,9 +2138,10 @@ DoubleVector sliceTemplate(int origin, Vector v1) { DoubleVector that = (DoubleVector) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((double)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = LongVector.broadcast((LongVector.LongSpecies) vspecies().asIntegral(), (long)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2168,9 +2169,10 @@ DoubleVector slice(int origin, @ForceInline DoubleVector sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((double)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = LongVector.broadcast((LongVector.LongSpecies) vspecies().asIntegral(), (long)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2189,10 +2191,10 @@ DoubleVector sliceTemplate(int origin) { DoubleVector that = (DoubleVector) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast((double)(origin)))); - iota = iotaShuffle(-origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = LongVector.broadcast((LongVector.LongSpecies) vspecies().asIntegral(), (long)origin); + VectorMask blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2229,10 +2231,10 @@ DoubleVector sliceTemplate(int origin) { DoubleVector unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast((double)(origin)))); - iota = iotaShuffle(-origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = LongVector.broadcast((LongVector.LongSpecies) vspecies().asIntegral(), (long)origin); + VectorMask blendMask = iotaVector.compare(VectorOperators.GE, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2255,13 +2257,11 @@ DoubleVector sliceTemplate(int origin) { final > DoubleVector rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, double.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2284,13 +2284,11 @@ DoubleVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, double.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2311,48 +2309,43 @@ DoubleVector rearrangeTemplate(Class shuffletype, S shuffle, DoubleVector v) { VectorMask valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); DoubleVector r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, double.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); DoubleVector r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, double.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle toShuffle0(DoubleSpecies dsp) { - double[] a = toArray(); - int[] sa = new int[a.length]; - for (int i = 0; i < a.length; i++) { - sa[i] = (int) a[i]; - } - return VectorShuffle.fromArray(dsp, sa, 0); + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { + throw new AssertionError(); } - /*package-private*/ @ForceInline - final - VectorShuffle toShuffleTemplate(Class shuffleType) { - DoubleSpecies vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), double.class, length(), - shuffleType, byte.class, length(), - this, vsp, - DoubleVector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); + LongVector idx = convert(VectorOperators.D2L, 0).reinterpretAsLongs(); + LongVector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + LongVector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -3731,9 +3724,10 @@ static final class DoubleSpecies extends AbstractSpecies { private DoubleSpecies(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of(double.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == Double.SIZE); } @@ -4019,6 +4013,7 @@ static DoubleSpecies species(VectorShape s) { = new DoubleSpecies(VectorShape.S_64_BIT, Double64Vector.class, Double64Vector.Double64Mask.class, + Double64Vector.Double64Shuffle.class, Double64Vector::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -4026,6 +4021,7 @@ static DoubleSpecies species(VectorShape s) { = new DoubleSpecies(VectorShape.S_128_BIT, Double128Vector.class, Double128Vector.Double128Mask.class, + Double128Vector.Double128Shuffle.class, Double128Vector::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -4033,6 +4029,7 @@ static DoubleSpecies species(VectorShape s) { = new DoubleSpecies(VectorShape.S_256_BIT, Double256Vector.class, Double256Vector.Double256Mask.class, + Double256Vector.Double256Shuffle.class, Double256Vector::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -4040,6 +4037,7 @@ static DoubleSpecies species(VectorShape s) { = new DoubleSpecies(VectorShape.S_512_BIT, Double512Vector.class, Double512Vector.Double512Mask.class, + Double512Vector.Double512Shuffle.class, Double512Vector::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -4047,6 +4045,7 @@ static DoubleSpecies species(VectorShape s) { = new DoubleSpecies(VectorShape.S_Max_BIT, DoubleMaxVector.class, DoubleMaxVector.DoubleMaxMask.class, + DoubleMaxVector.DoubleMaxShuffle.class, DoubleMaxVector::new); /** diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java index 79239532cc69b..77301e4c77381 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java @@ -141,24 +141,15 @@ Float128Mask maskFromArray(boolean[] bits) { @ForceInline Float128Shuffle iotaShuffle() { return Float128Shuffle.IOTA; } + @Override @ForceInline Float128Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Float128Shuffle)VectorSupport.shuffleIota(ETYPE, Float128Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Float128Shuffle)VectorSupport.shuffleIota(ETYPE, Float128Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Float128Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float128Shuffle shuffleFromBytes(byte[] reorder) { return new Float128Shuffle(reorder); } - - @Override - @ForceInline - Float128Shuffle shuffleFromArray(int[] indexes, int i) { return new Float128Shuffle(indexes, i); } + Float128Shuffle shuffleFromArray(int[] indices, int i) { return new Float128Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Float128Shuffle.class); // specialize + public final Float128Shuffle toShuffle() { + return (Float128Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -784,25 +782,28 @@ static Float128Mask maskAll(boolean bit) { static final class Float128Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Float128Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Float128Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Float128Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Float128Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Float128Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Float128Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Float128Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public FloatSpecies vspecies() { return VSPECIES; } @@ -810,47 +811,98 @@ public FloatSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Float128Shuffle IOTA = new Float128Shuffle(IDENTITY); @Override @ForceInline public Float128Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Float128Shuffle.class, this, VLENGTH, - (s) -> ((Float128Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Float128Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int128Vector toBitsVector() { + return (Int128Vector) super.toBitsVectorTemplate(); + } + + @Override + Int128Vector toBitsVector0() { + return ((Int128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); + } + + @Override + @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); } @Override @ForceInline - public Float128Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Float128Shuffle.class, this, VLENGTH, - (s) -> ((Float128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public final Float128Mask laneIsValid() { + return (Float128Mask) 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)) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Float128Shuffle rearrange(VectorShuffle shuffle) { - Float128Shuffle s = (Float128Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Float128Shuffle wrapIndexes() { + Int128Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int128Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Float128Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Float128Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java index 5f5a26fd316a3..f81a9adda423a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java @@ -141,24 +141,15 @@ Float256Mask maskFromArray(boolean[] bits) { @ForceInline Float256Shuffle iotaShuffle() { return Float256Shuffle.IOTA; } + @Override @ForceInline Float256Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Float256Shuffle)VectorSupport.shuffleIota(ETYPE, Float256Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Float256Shuffle)VectorSupport.shuffleIota(ETYPE, Float256Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Float256Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float256Shuffle shuffleFromBytes(byte[] reorder) { return new Float256Shuffle(reorder); } - - @Override - @ForceInline - Float256Shuffle shuffleFromArray(int[] indexes, int i) { return new Float256Shuffle(indexes, i); } + Float256Shuffle shuffleFromArray(int[] indices, int i) { return new Float256Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Float256Shuffle.class); // specialize + public final Float256Shuffle toShuffle() { + return (Float256Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -792,25 +790,28 @@ static Float256Mask maskAll(boolean bit) { static final class Float256Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Float256Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Float256Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Float256Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Float256Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Float256Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Float256Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Float256Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public FloatSpecies vspecies() { return VSPECIES; } @@ -818,47 +819,98 @@ public FloatSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Float256Shuffle IOTA = new Float256Shuffle(IDENTITY); @Override @ForceInline public Float256Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Float256Shuffle.class, this, VLENGTH, - (s) -> ((Float256Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Float256Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int256Vector toBitsVector() { + return (Int256Vector) super.toBitsVectorTemplate(); + } + + @Override + Int256Vector toBitsVector0() { + return ((Int256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); + } + + @Override + @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); } @Override @ForceInline - public Float256Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Float256Shuffle.class, this, VLENGTH, - (s) -> ((Float256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public final Float256Mask laneIsValid() { + return (Float256Mask) 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)) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Float256Shuffle rearrange(VectorShuffle shuffle) { - Float256Shuffle s = (Float256Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Float256Shuffle wrapIndexes() { + Int256Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int256Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Float256Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Float256Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java index f8c191ea016e3..1cf6afca4b4d7 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java @@ -141,24 +141,15 @@ Float512Mask maskFromArray(boolean[] bits) { @ForceInline Float512Shuffle iotaShuffle() { return Float512Shuffle.IOTA; } + @Override @ForceInline Float512Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Float512Shuffle)VectorSupport.shuffleIota(ETYPE, Float512Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Float512Shuffle)VectorSupport.shuffleIota(ETYPE, Float512Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Float512Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float512Shuffle shuffleFromBytes(byte[] reorder) { return new Float512Shuffle(reorder); } - - @Override - @ForceInline - Float512Shuffle shuffleFromArray(int[] indexes, int i) { return new Float512Shuffle(indexes, i); } + Float512Shuffle shuffleFromArray(int[] indices, int i) { return new Float512Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Float512Shuffle.class); // specialize + public final Float512Shuffle toShuffle() { + return (Float512Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -808,25 +806,28 @@ static Float512Mask maskAll(boolean bit) { static final class Float512Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Float512Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Float512Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Float512Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Float512Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Float512Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Float512Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Float512Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public FloatSpecies vspecies() { return VSPECIES; } @@ -834,47 +835,98 @@ public FloatSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Float512Shuffle IOTA = new Float512Shuffle(IDENTITY); @Override @ForceInline public Float512Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Float512Shuffle.class, this, VLENGTH, - (s) -> ((Float512Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Float512Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int512Vector toBitsVector() { + return (Int512Vector) super.toBitsVectorTemplate(); + } + + @Override + Int512Vector toBitsVector0() { + return ((Int512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); + } + + @Override + @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); } @Override @ForceInline - public Float512Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Float512Shuffle.class, this, VLENGTH, - (s) -> ((Float512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public final Float512Mask laneIsValid() { + return (Float512Mask) 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)) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Float512Shuffle rearrange(VectorShuffle shuffle) { - Float512Shuffle s = (Float512Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Float512Shuffle wrapIndexes() { + Int512Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int512Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Float512Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Float512Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java index 9496e5988680b..1974b93d0ae01 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java @@ -141,24 +141,15 @@ Float64Mask maskFromArray(boolean[] bits) { @ForceInline Float64Shuffle iotaShuffle() { return Float64Shuffle.IOTA; } + @Override @ForceInline Float64Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Float64Shuffle)VectorSupport.shuffleIota(ETYPE, Float64Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Float64Shuffle)VectorSupport.shuffleIota(ETYPE, Float64Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Float64Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float64Shuffle shuffleFromBytes(byte[] reorder) { return new Float64Shuffle(reorder); } - - @Override - @ForceInline - Float64Shuffle shuffleFromArray(int[] indexes, int i) { return new Float64Shuffle(indexes, i); } + Float64Shuffle shuffleFromArray(int[] indices, int i) { return new Float64Shuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Float64Shuffle.class); // specialize + public final Float64Shuffle toShuffle() { + return (Float64Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -780,25 +778,28 @@ static Float64Mask maskAll(boolean bit) { static final class Float64Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Float64Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Float64Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Float64Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Float64Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Float64Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Float64Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Float64Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public FloatSpecies vspecies() { return VSPECIES; } @@ -806,47 +807,98 @@ public FloatSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Float64Shuffle IOTA = new Float64Shuffle(IDENTITY); @Override @ForceInline public Float64Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Float64Shuffle.class, this, VLENGTH, - (s) -> ((Float64Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (Float64Vector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int64Vector toBitsVector() { + return (Int64Vector) super.toBitsVectorTemplate(); + } + + @Override + Int64Vector toBitsVector0() { + return ((Int64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); + } + + @Override + @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); } @Override @ForceInline - public Float64Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Float64Shuffle.class, this, VLENGTH, - (s) -> ((Float64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public final Float64Mask laneIsValid() { + return (Float64Mask) 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)) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Float64Shuffle rearrange(VectorShuffle shuffle) { - Float64Shuffle s = (Float64Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Float64Shuffle wrapIndexes() { + Int64Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int64Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Float64Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Float64Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java index 6f093957262aa..14981d021511a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java @@ -141,24 +141,15 @@ FloatMaxMask maskFromArray(boolean[] bits) { @ForceInline FloatMaxShuffle iotaShuffle() { return FloatMaxShuffle.IOTA; } + @Override @ForceInline FloatMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (FloatMaxShuffle)VectorSupport.shuffleIota(ETYPE, FloatMaxShuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (FloatMaxShuffle)VectorSupport.shuffleIota(ETYPE, FloatMaxShuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (FloatMaxShuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - FloatMaxShuffle shuffleFromBytes(byte[] reorder) { return new FloatMaxShuffle(reorder); } - - @Override - @ForceInline - FloatMaxShuffle shuffleFromArray(int[] indexes, int i) { return new FloatMaxShuffle(indexes, i); } + FloatMaxShuffle shuffleFromArray(int[] indices, int i) { return new FloatMaxShuffle(indices, i); } @Override @ForceInline @@ -344,9 +335,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + throw new AssertionError(); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(FloatMaxShuffle.class); // specialize + public final FloatMaxShuffle toShuffle() { + return (FloatMaxShuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -777,25 +775,28 @@ static FloatMaxMask maskAll(boolean bit) { static final class FloatMaxShuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM + static final Class ETYPE = int.class; // used by the JVM - FloatMaxShuffle(byte[] reorder) { - super(VLENGTH, reorder); + FloatMaxShuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public FloatMaxShuffle(int[] reorder) { - super(VLENGTH, reorder); + FloatMaxShuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public FloatMaxShuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + FloatMaxShuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public FloatMaxShuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public FloatSpecies vspecies() { return VSPECIES; } @@ -803,47 +804,98 @@ public FloatSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final FloatMaxShuffle IOTA = new FloatMaxShuffle(IDENTITY); @Override @ForceInline public FloatMaxVector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, FloatMaxShuffle.class, this, VLENGTH, - (s) -> ((FloatMaxVector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return (FloatMaxVector) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + IntMaxVector toBitsVector() { + return (IntMaxVector) super.toBitsVectorTemplate(); + } + + @Override + IntMaxVector toBitsVector0() { + return ((IntMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); + } + + @Override + @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); } @Override @ForceInline - public FloatMaxShuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, FloatMaxShuffle.class, this, VLENGTH, - (s) -> ((FloatMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public final FloatMaxMask laneIsValid() { + return (FloatMaxMask) 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)) + .toShuffle(vspecies(), false); } @ForceInline @Override - public FloatMaxShuffle rearrange(VectorShuffle shuffle) { - FloatMaxShuffle s = (FloatMaxShuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final FloatMaxShuffle wrapIndexes() { + IntMaxVector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (IntMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (IntMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (FloatMaxShuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new FloatMaxShuffle(r); + return true; } } 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 a3686d467a746..ab056d1c397a1 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 @@ -966,7 +966,7 @@ FloatVector lanewise(VectorOperators.Binary op, // and broadcast, but it would be more surprising not to continue // the obvious pattern started by unary and binary. - /** + /** * {@inheritDoc} * @see #lanewise(VectorOperators.Ternary,float,float,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,float,VectorMask) @@ -2150,9 +2150,10 @@ FloatVector sliceTemplate(int origin, Vector v1) { FloatVector that = (FloatVector) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((float)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = IntVector.broadcast((IntVector.IntSpecies) vspecies().asIntegral(), (int)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2180,9 +2181,10 @@ FloatVector slice(int origin, @ForceInline FloatVector sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((float)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = IntVector.broadcast((IntVector.IntSpecies) vspecies().asIntegral(), (int)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2201,10 +2203,10 @@ FloatVector sliceTemplate(int origin) { FloatVector that = (FloatVector) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast((float)(origin)))); - iota = iotaShuffle(-origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = IntVector.broadcast((IntVector.IntSpecies) vspecies().asIntegral(), (int)origin); + VectorMask blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2241,10 +2243,10 @@ FloatVector sliceTemplate(int origin) { FloatVector unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast((float)(origin)))); - iota = iotaShuffle(-origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = IntVector.broadcast((IntVector.IntSpecies) vspecies().asIntegral(), (int)origin); + VectorMask blendMask = iotaVector.compare(VectorOperators.GE, filter).cast(vspecies()); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2267,13 +2269,11 @@ FloatVector sliceTemplate(int origin) { final > FloatVector rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, float.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2296,13 +2296,11 @@ FloatVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, float.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2323,48 +2321,43 @@ FloatVector rearrangeTemplate(Class shuffletype, S shuffle, FloatVector v) { VectorMask valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); FloatVector r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, float.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); FloatVector r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, float.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle toShuffle0(FloatSpecies dsp) { - float[] a = toArray(); - int[] sa = new int[a.length]; - for (int i = 0; i < a.length; i++) { - sa[i] = (int) a[i]; - } - return VectorShuffle.fromArray(dsp, sa, 0); + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { + throw new AssertionError(); } - /*package-private*/ @ForceInline - final - VectorShuffle toShuffleTemplate(Class shuffleType) { - FloatSpecies vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), float.class, length(), - shuffleType, byte.class, length(), - this, vsp, - FloatVector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); + IntVector idx = convert(VectorOperators.F2I, 0).reinterpretAsInts(); + IntVector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + IntVector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -3681,9 +3674,10 @@ static final class FloatSpecies extends AbstractSpecies { private FloatSpecies(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of(float.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == Float.SIZE); } @@ -3969,6 +3963,7 @@ static FloatSpecies species(VectorShape s) { = new FloatSpecies(VectorShape.S_64_BIT, Float64Vector.class, Float64Vector.Float64Mask.class, + Float64Vector.Float64Shuffle.class, Float64Vector::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -3976,6 +3971,7 @@ static FloatSpecies species(VectorShape s) { = new FloatSpecies(VectorShape.S_128_BIT, Float128Vector.class, Float128Vector.Float128Mask.class, + Float128Vector.Float128Shuffle.class, Float128Vector::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -3983,6 +3979,7 @@ static FloatSpecies species(VectorShape s) { = new FloatSpecies(VectorShape.S_256_BIT, Float256Vector.class, Float256Vector.Float256Mask.class, + Float256Vector.Float256Shuffle.class, Float256Vector::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -3990,6 +3987,7 @@ static FloatSpecies species(VectorShape s) { = new FloatSpecies(VectorShape.S_512_BIT, Float512Vector.class, Float512Vector.Float512Mask.class, + Float512Vector.Float512Shuffle.class, Float512Vector::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -3997,6 +3995,7 @@ static FloatSpecies species(VectorShape s) { = new FloatSpecies(VectorShape.S_Max_BIT, FloatMaxVector.class, FloatMaxVector.FloatMaxMask.class, + FloatMaxVector.FloatMaxShuffle.class, FloatMaxVector::new); /** diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java index 4aa1e8044b092..a4660dd94c630 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java @@ -141,24 +141,15 @@ Int128Mask maskFromArray(boolean[] bits) { @ForceInline Int128Shuffle iotaShuffle() { return Int128Shuffle.IOTA; } + @Override @ForceInline Int128Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Int128Shuffle)VectorSupport.shuffleIota(ETYPE, Int128Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Int128Shuffle)VectorSupport.shuffleIota(ETYPE, Int128Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Int128Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int128Shuffle shuffleFromBytes(byte[] reorder) { return new Int128Shuffle(reorder); } - - @Override - @ForceInline - Int128Shuffle shuffleFromArray(int[] indexes, int i) { return new Int128Shuffle(indexes, i); } + Int128Shuffle shuffleFromArray(int[] indices, int i) { return new Int128Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Int128Shuffle.class); // specialize + public final Int128Shuffle toShuffle() { + return (Int128Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -797,23 +795,26 @@ static final class Int128Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = int.class; // used by the JVM - Int128Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Int128Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Int128Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Int128Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Int128Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Int128Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Int128Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public IntSpecies vspecies() { return VSPECIES; } @@ -821,47 +822,98 @@ public IntSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Int128Shuffle IOTA = new Int128Shuffle(IDENTITY); @Override @ForceInline public Int128Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Int128Shuffle.class, this, VLENGTH, - (s) -> ((Int128Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int128Vector toBitsVector() { + return (Int128Vector) super.toBitsVectorTemplate(); + } + + @Override + Int128Vector toBitsVector0() { + return ((Int128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Int128Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Int128Shuffle.class, this, VLENGTH, - (s) -> ((Int128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); + } + @Override - public Int128Shuffle rearrange(VectorShuffle shuffle) { - Int128Shuffle s = (Int128Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Int128Mask laneIsValid() { + return (Int128Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Int128Shuffle rearrange(VectorShuffle shuffle) { + Int128Shuffle concreteShuffle = (Int128Shuffle) shuffle; + return (Int128Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Int128Shuffle wrapIndexes() { + Int128Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int128Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Int128Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Int128Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java index 753f96f216ff3..284ee1cebcab2 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java @@ -141,24 +141,15 @@ Int256Mask maskFromArray(boolean[] bits) { @ForceInline Int256Shuffle iotaShuffle() { return Int256Shuffle.IOTA; } + @Override @ForceInline Int256Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Int256Shuffle)VectorSupport.shuffleIota(ETYPE, Int256Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Int256Shuffle)VectorSupport.shuffleIota(ETYPE, Int256Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Int256Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int256Shuffle shuffleFromBytes(byte[] reorder) { return new Int256Shuffle(reorder); } - - @Override - @ForceInline - Int256Shuffle shuffleFromArray(int[] indexes, int i) { return new Int256Shuffle(indexes, i); } + Int256Shuffle shuffleFromArray(int[] indices, int i) { return new Int256Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Int256Shuffle.class); // specialize + public final Int256Shuffle toShuffle() { + return (Int256Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -805,23 +803,26 @@ static final class Int256Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = int.class; // used by the JVM - Int256Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Int256Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Int256Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Int256Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Int256Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Int256Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Int256Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public IntSpecies vspecies() { return VSPECIES; } @@ -829,47 +830,98 @@ public IntSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Int256Shuffle IOTA = new Int256Shuffle(IDENTITY); @Override @ForceInline public Int256Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Int256Shuffle.class, this, VLENGTH, - (s) -> ((Int256Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int256Vector toBitsVector() { + return (Int256Vector) super.toBitsVectorTemplate(); + } + + @Override + Int256Vector toBitsVector0() { + return ((Int256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Int256Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Int256Shuffle.class, this, VLENGTH, - (s) -> ((Int256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); + } + @Override - public Int256Shuffle rearrange(VectorShuffle shuffle) { - Int256Shuffle s = (Int256Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Int256Mask laneIsValid() { + return (Int256Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Int256Shuffle rearrange(VectorShuffle shuffle) { + Int256Shuffle concreteShuffle = (Int256Shuffle) shuffle; + return (Int256Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Int256Shuffle wrapIndexes() { + Int256Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int256Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Int256Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Int256Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java index 8e6ed6fc882e8..f0c8ddabfaeed 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java @@ -141,24 +141,15 @@ Int512Mask maskFromArray(boolean[] bits) { @ForceInline Int512Shuffle iotaShuffle() { return Int512Shuffle.IOTA; } + @Override @ForceInline Int512Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Int512Shuffle)VectorSupport.shuffleIota(ETYPE, Int512Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Int512Shuffle)VectorSupport.shuffleIota(ETYPE, Int512Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Int512Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int512Shuffle shuffleFromBytes(byte[] reorder) { return new Int512Shuffle(reorder); } - - @Override - @ForceInline - Int512Shuffle shuffleFromArray(int[] indexes, int i) { return new Int512Shuffle(indexes, i); } + Int512Shuffle shuffleFromArray(int[] indices, int i) { return new Int512Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Int512Shuffle.class); // specialize + public final Int512Shuffle toShuffle() { + return (Int512Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -821,23 +819,26 @@ static final class Int512Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = int.class; // used by the JVM - Int512Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Int512Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Int512Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Int512Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Int512Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Int512Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Int512Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public IntSpecies vspecies() { return VSPECIES; } @@ -845,47 +846,98 @@ public IntSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Int512Shuffle IOTA = new Int512Shuffle(IDENTITY); @Override @ForceInline public Int512Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Int512Shuffle.class, this, VLENGTH, - (s) -> ((Int512Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int512Vector toBitsVector() { + return (Int512Vector) super.toBitsVectorTemplate(); + } + + @Override + Int512Vector toBitsVector0() { + return ((Int512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Int512Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Int512Shuffle.class, this, VLENGTH, - (s) -> ((Int512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); + } + @Override - public Int512Shuffle rearrange(VectorShuffle shuffle) { - Int512Shuffle s = (Int512Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Int512Mask laneIsValid() { + return (Int512Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Int512Shuffle rearrange(VectorShuffle shuffle) { + Int512Shuffle concreteShuffle = (Int512Shuffle) shuffle; + return (Int512Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Int512Shuffle wrapIndexes() { + Int512Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int512Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Int512Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Int512Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java index 98cd39d9beb03..27963859a0910 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java @@ -141,24 +141,15 @@ Int64Mask maskFromArray(boolean[] bits) { @ForceInline Int64Shuffle iotaShuffle() { return Int64Shuffle.IOTA; } + @Override @ForceInline Int64Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Int64Shuffle)VectorSupport.shuffleIota(ETYPE, Int64Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Int64Shuffle)VectorSupport.shuffleIota(ETYPE, Int64Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Int64Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int64Shuffle shuffleFromBytes(byte[] reorder) { return new Int64Shuffle(reorder); } - - @Override - @ForceInline - Int64Shuffle shuffleFromArray(int[] indexes, int i) { return new Int64Shuffle(indexes, i); } + Int64Shuffle shuffleFromArray(int[] indices, int i) { return new Int64Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Int64Shuffle.class); // specialize + public final Int64Shuffle toShuffle() { + return (Int64Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -793,23 +791,26 @@ static final class Int64Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = int.class; // used by the JVM - Int64Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Int64Shuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Int64Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Int64Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Int64Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Int64Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Int64Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public IntSpecies vspecies() { return VSPECIES; } @@ -817,47 +818,98 @@ public IntSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final Int64Shuffle IOTA = new Int64Shuffle(IDENTITY); @Override @ForceInline public Int64Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Int64Shuffle.class, this, VLENGTH, - (s) -> ((Int64Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Int64Vector toBitsVector() { + return (Int64Vector) super.toBitsVectorTemplate(); + } + + @Override + Int64Vector toBitsVector0() { + return ((Int64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Int64Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Int64Shuffle.class, this, VLENGTH, - (s) -> ((Int64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); + } + @Override - public Int64Shuffle rearrange(VectorShuffle shuffle) { - Int64Shuffle s = (Int64Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Int64Mask laneIsValid() { + return (Int64Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Int64Shuffle rearrange(VectorShuffle shuffle) { + Int64Shuffle concreteShuffle = (Int64Shuffle) shuffle; + return (Int64Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Int64Shuffle wrapIndexes() { + Int64Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Int64Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Int64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Int64Shuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Int64Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java index f301161b980af..d5140567ca0e6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java @@ -141,24 +141,15 @@ IntMaxMask maskFromArray(boolean[] bits) { @ForceInline IntMaxShuffle iotaShuffle() { return IntMaxShuffle.IOTA; } + @Override @ForceInline IntMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (IntMaxShuffle)VectorSupport.shuffleIota(ETYPE, IntMaxShuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (IntMaxShuffle)VectorSupport.shuffleIota(ETYPE, IntMaxShuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (IntMaxShuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - IntMaxShuffle shuffleFromBytes(byte[] reorder) { return new IntMaxShuffle(reorder); } - - @Override - @ForceInline - IntMaxShuffle shuffleFromArray(int[] indexes, int i) { return new IntMaxShuffle(indexes, i); } + IntMaxShuffle shuffleFromArray(int[] indices, int i) { return new IntMaxShuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(IntMaxShuffle.class); // specialize + public final IntMaxShuffle toShuffle() { + return (IntMaxShuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -802,23 +800,26 @@ static final class IntMaxShuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = int.class; // used by the JVM - IntMaxShuffle(byte[] reorder) { - super(VLENGTH, reorder); + IntMaxShuffle(int[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public IntMaxShuffle(int[] reorder) { - super(VLENGTH, reorder); + IntMaxShuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public IntMaxShuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + IntMaxShuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public IntMaxShuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + int[] indices() { + return (int[])getPayload(); } @Override + @ForceInline public IntSpecies vspecies() { return VSPECIES; } @@ -826,47 +827,98 @@ public IntSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Integer.MAX_VALUE); + assert(Integer.MIN_VALUE <= -VLENGTH); } static final IntMaxShuffle IOTA = new IntMaxShuffle(IDENTITY); @Override @ForceInline public IntMaxVector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, IntMaxShuffle.class, this, VLENGTH, - (s) -> ((IntMaxVector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + IntMaxVector toBitsVector() { + return (IntMaxVector) super.toBitsVectorTemplate(); + } + + @Override + IntMaxVector toBitsVector0() { + return ((IntMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public IntMaxShuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, IntMaxShuffle.class, this, VLENGTH, - (s) -> ((IntMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + toBitsVector().intoArray(a, offset); + } + @Override - public IntMaxShuffle rearrange(VectorShuffle shuffle) { - IntMaxShuffle s = (IntMaxShuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final IntMaxMask laneIsValid() { + return (IntMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final IntMaxShuffle rearrange(VectorShuffle shuffle) { + IntMaxShuffle concreteShuffle = (IntMaxShuffle) shuffle; + return (IntMaxShuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final IntMaxShuffle wrapIndexes() { + IntMaxVector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (IntMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (IntMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (IntMaxShuffle) v.toShuffle(vspecies(), false); + } + + private static int[] prepare(int[] indices, int offset) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static int[] prepare(IntUnaryOperator f) { + int[] a = new int[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (int)si; + } + return a; + } + + private static boolean indicesInRange(int[] indices) { + int length = indices.length; + for (int si : indices) { + if (si >= (int)length || si < (int)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new IntMaxShuffle(r); + return true; } } 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 390c80260831e..063b0c0d8e83b 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 @@ -1099,7 +1099,7 @@ private static VectorBroadcastIntOp> broadcastInt // and broadcast, but it would be more surprising not to continue // the obvious pattern started by unary and binary. - /** + /** * {@inheritDoc} * @see #lanewise(VectorOperators.Ternary,int,int,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,int,VectorMask) @@ -2293,9 +2293,10 @@ IntVector sliceTemplate(int origin, Vector v1) { IntVector that = (IntVector) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((int)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = broadcast((int)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2323,9 +2324,10 @@ IntVector slice(int origin, @ForceInline IntVector sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((int)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = broadcast((int)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2344,10 +2346,10 @@ IntVector sliceTemplate(int origin) { IntVector that = (IntVector) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast((int)(origin)))); - iota = iotaShuffle(-origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = broadcast((int)origin); + VectorMask blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2384,10 +2386,10 @@ IntVector sliceTemplate(int origin) { IntVector unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast((int)(origin)))); - iota = iotaShuffle(-origin, 1, true); + IntVector iotaVector = (IntVector) iotaShuffle().toBitsVector(); + IntVector filter = broadcast((int)origin); + VectorMask blendMask = iotaVector.compare(VectorOperators.GE, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2410,13 +2412,11 @@ IntVector sliceTemplate(int origin) { final > IntVector rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, int.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2439,13 +2439,11 @@ IntVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, int.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2466,30 +2464,29 @@ IntVector rearrangeTemplate(Class shuffletype, S shuffle, IntVector v) { VectorMask valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); IntVector r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, int.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); IntVector r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, int.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle toShuffle0(IntSpecies dsp) { + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { + assert(dsp.length() == vspecies().length()); int[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { @@ -2498,16 +2495,18 @@ VectorShuffle toShuffle0(IntSpecies dsp) { return VectorShuffle.fromArray(dsp, sa, 0); } - /*package-private*/ @ForceInline - final - VectorShuffle toShuffleTemplate(Class shuffleType) { - IntSpecies vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), int.class, length(), - shuffleType, byte.class, length(), - this, vsp, - IntVector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); + IntVector idx = this; + IntVector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + IntVector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -3849,9 +3848,10 @@ static final class IntSpecies extends AbstractSpecies { private IntSpecies(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of(int.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == Integer.SIZE); } @@ -4137,6 +4137,7 @@ static IntSpecies species(VectorShape s) { = new IntSpecies(VectorShape.S_64_BIT, Int64Vector.class, Int64Vector.Int64Mask.class, + Int64Vector.Int64Shuffle.class, Int64Vector::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -4144,6 +4145,7 @@ static IntSpecies species(VectorShape s) { = new IntSpecies(VectorShape.S_128_BIT, Int128Vector.class, Int128Vector.Int128Mask.class, + Int128Vector.Int128Shuffle.class, Int128Vector::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -4151,6 +4153,7 @@ static IntSpecies species(VectorShape s) { = new IntSpecies(VectorShape.S_256_BIT, Int256Vector.class, Int256Vector.Int256Mask.class, + Int256Vector.Int256Shuffle.class, Int256Vector::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -4158,6 +4161,7 @@ static IntSpecies species(VectorShape s) { = new IntSpecies(VectorShape.S_512_BIT, Int512Vector.class, Int512Vector.Int512Mask.class, + Int512Vector.Int512Shuffle.class, Int512Vector::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -4165,6 +4169,7 @@ static IntSpecies species(VectorShape s) { = new IntSpecies(VectorShape.S_Max_BIT, IntMaxVector.class, IntMaxVector.IntMaxMask.class, + IntMaxVector.IntMaxShuffle.class, IntMaxVector::new); /** diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java index c65816a4d6c88..8b57f1c498cb6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java @@ -136,24 +136,15 @@ Long128Mask maskFromArray(boolean[] bits) { @ForceInline Long128Shuffle iotaShuffle() { return Long128Shuffle.IOTA; } + @Override @ForceInline Long128Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Long128Shuffle)VectorSupport.shuffleIota(ETYPE, Long128Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Long128Shuffle)VectorSupport.shuffleIota(ETYPE, Long128Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Long128Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long128Shuffle shuffleFromBytes(byte[] reorder) { return new Long128Shuffle(reorder); } - - @Override - @ForceInline - Long128Shuffle shuffleFromArray(int[] indexes, int i) { return new Long128Shuffle(indexes, i); } + Long128Shuffle shuffleFromArray(int[] indices, int i) { return new Long128Shuffle(indices, i); } @Override @ForceInline @@ -352,9 +343,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Long128Shuffle.class); // specialize + public final Long128Shuffle toShuffle() { + return (Long128Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -783,23 +781,26 @@ static final class Long128Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = long.class; // used by the JVM - Long128Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Long128Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Long128Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Long128Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Long128Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Long128Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Long128Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public LongSpecies vspecies() { return VSPECIES; } @@ -807,47 +808,122 @@ public LongSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Long128Shuffle IOTA = new Long128Shuffle(IDENTITY); @Override @ForceInline public Long128Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Long128Shuffle.class, this, VLENGTH, - (s) -> ((Long128Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long128Vector toBitsVector() { + return (Long128Vector) super.toBitsVectorTemplate(); + } + + @Override + Long128Vector toBitsVector0() { + return ((Long128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } @Override @ForceInline - public Long128Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Long128Shuffle.class, this, VLENGTH, - (s) -> ((Long128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + + @Override + @ForceInline + public final Long128Mask laneIsValid() { + return (Long128Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Long128Shuffle rearrange(VectorShuffle shuffle) { + Long128Shuffle concreteShuffle = (Long128Shuffle) shuffle; + return (Long128Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Long128Shuffle rearrange(VectorShuffle shuffle) { - Long128Shuffle s = (Long128Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Long128Shuffle wrapIndexes() { + Long128Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long128Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Long128Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Long128Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java index 7ca3e43e92b87..3f808fe1a2f44 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java @@ -136,24 +136,15 @@ Long256Mask maskFromArray(boolean[] bits) { @ForceInline Long256Shuffle iotaShuffle() { return Long256Shuffle.IOTA; } + @Override @ForceInline Long256Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Long256Shuffle)VectorSupport.shuffleIota(ETYPE, Long256Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Long256Shuffle)VectorSupport.shuffleIota(ETYPE, Long256Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Long256Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long256Shuffle shuffleFromBytes(byte[] reorder) { return new Long256Shuffle(reorder); } - - @Override - @ForceInline - Long256Shuffle shuffleFromArray(int[] indexes, int i) { return new Long256Shuffle(indexes, i); } + Long256Shuffle shuffleFromArray(int[] indices, int i) { return new Long256Shuffle(indices, i); } @Override @ForceInline @@ -352,9 +343,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Long256Shuffle.class); // specialize + public final Long256Shuffle toShuffle() { + return (Long256Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -787,23 +785,26 @@ static final class Long256Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = long.class; // used by the JVM - Long256Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Long256Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Long256Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Long256Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Long256Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Long256Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Long256Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public LongSpecies vspecies() { return VSPECIES; } @@ -811,47 +812,122 @@ public LongSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Long256Shuffle IOTA = new Long256Shuffle(IDENTITY); @Override @ForceInline public Long256Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Long256Shuffle.class, this, VLENGTH, - (s) -> ((Long256Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long256Vector toBitsVector() { + return (Long256Vector) super.toBitsVectorTemplate(); + } + + @Override + Long256Vector toBitsVector0() { + return ((Long256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } @Override @ForceInline - public Long256Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Long256Shuffle.class, this, VLENGTH, - (s) -> ((Long256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + + @Override + @ForceInline + public final Long256Mask laneIsValid() { + return (Long256Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Long256Shuffle rearrange(VectorShuffle shuffle) { + Long256Shuffle concreteShuffle = (Long256Shuffle) shuffle; + return (Long256Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Long256Shuffle rearrange(VectorShuffle shuffle) { - Long256Shuffle s = (Long256Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Long256Shuffle wrapIndexes() { + Long256Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long256Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Long256Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Long256Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java index 317cac1f11085..3d5e00b09c63f 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java @@ -136,24 +136,15 @@ Long512Mask maskFromArray(boolean[] bits) { @ForceInline Long512Shuffle iotaShuffle() { return Long512Shuffle.IOTA; } + @Override @ForceInline Long512Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Long512Shuffle)VectorSupport.shuffleIota(ETYPE, Long512Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Long512Shuffle)VectorSupport.shuffleIota(ETYPE, Long512Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Long512Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long512Shuffle shuffleFromBytes(byte[] reorder) { return new Long512Shuffle(reorder); } - - @Override - @ForceInline - Long512Shuffle shuffleFromArray(int[] indexes, int i) { return new Long512Shuffle(indexes, i); } + Long512Shuffle shuffleFromArray(int[] indices, int i) { return new Long512Shuffle(indices, i); } @Override @ForceInline @@ -352,9 +343,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Long512Shuffle.class); // specialize + public final Long512Shuffle toShuffle() { + return (Long512Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -795,23 +793,26 @@ static final class Long512Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = long.class; // used by the JVM - Long512Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Long512Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Long512Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Long512Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Long512Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Long512Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Long512Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public LongSpecies vspecies() { return VSPECIES; } @@ -819,47 +820,122 @@ public LongSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Long512Shuffle IOTA = new Long512Shuffle(IDENTITY); @Override @ForceInline public Long512Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Long512Shuffle.class, this, VLENGTH, - (s) -> ((Long512Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long512Vector toBitsVector() { + return (Long512Vector) super.toBitsVectorTemplate(); + } + + @Override + Long512Vector toBitsVector0() { + return ((Long512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } @Override @ForceInline - public Long512Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Long512Shuffle.class, this, VLENGTH, - (s) -> ((Long512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + + @Override + @ForceInline + public final Long512Mask laneIsValid() { + return (Long512Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Long512Shuffle rearrange(VectorShuffle shuffle) { + Long512Shuffle concreteShuffle = (Long512Shuffle) shuffle; + return (Long512Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Long512Shuffle rearrange(VectorShuffle shuffle) { - Long512Shuffle s = (Long512Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Long512Shuffle wrapIndexes() { + Long512Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long512Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Long512Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Long512Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java index b13712595dbdd..d34905dbce087 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java @@ -136,24 +136,15 @@ Long64Mask maskFromArray(boolean[] bits) { @ForceInline Long64Shuffle iotaShuffle() { return Long64Shuffle.IOTA; } + @Override @ForceInline Long64Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Long64Shuffle)VectorSupport.shuffleIota(ETYPE, Long64Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Long64Shuffle)VectorSupport.shuffleIota(ETYPE, Long64Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Long64Shuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long64Shuffle shuffleFromBytes(byte[] reorder) { return new Long64Shuffle(reorder); } - - @Override - @ForceInline - Long64Shuffle shuffleFromArray(int[] indexes, int i) { return new Long64Shuffle(indexes, i); } + Long64Shuffle shuffleFromArray(int[] indices, int i) { return new Long64Shuffle(indices, i); } @Override @ForceInline @@ -352,9 +343,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Long64Shuffle.class); // specialize + public final Long64Shuffle toShuffle() { + return (Long64Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -781,23 +779,26 @@ static final class Long64Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = long.class; // used by the JVM - Long64Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Long64Shuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Long64Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Long64Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Long64Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Long64Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Long64Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public LongSpecies vspecies() { return VSPECIES; } @@ -805,47 +806,122 @@ public LongSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final Long64Shuffle IOTA = new Long64Shuffle(IDENTITY); @Override @ForceInline public Long64Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Long64Shuffle.class, this, VLENGTH, - (s) -> ((Long64Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Long64Vector toBitsVector() { + return (Long64Vector) super.toBitsVectorTemplate(); + } + + @Override + Long64Vector toBitsVector0() { + return ((Long64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } @Override @ForceInline - public Long64Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Long64Shuffle.class, this, VLENGTH, - (s) -> ((Long64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + + @Override + @ForceInline + public final Long64Mask laneIsValid() { + return (Long64Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Long64Shuffle rearrange(VectorShuffle shuffle) { + Long64Shuffle concreteShuffle = (Long64Shuffle) shuffle; + return (Long64Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); } @ForceInline @Override - public Long64Shuffle rearrange(VectorShuffle shuffle) { - Long64Shuffle s = (Long64Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final Long64Shuffle wrapIndexes() { + Long64Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Long64Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Long64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Long64Shuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Long64Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java index 9edc442be88ac..84ff9d17444ba 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java @@ -136,24 +136,15 @@ LongMaxMask maskFromArray(boolean[] bits) { @ForceInline LongMaxShuffle iotaShuffle() { return LongMaxShuffle.IOTA; } + @Override @ForceInline LongMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (LongMaxShuffle)VectorSupport.shuffleIota(ETYPE, LongMaxShuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (LongMaxShuffle)VectorSupport.shuffleIota(ETYPE, LongMaxShuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (LongMaxShuffle) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - LongMaxShuffle shuffleFromBytes(byte[] reorder) { return new LongMaxShuffle(reorder); } - - @Override - @ForceInline - LongMaxShuffle shuffleFromArray(int[] indexes, int i) { return new LongMaxShuffle(indexes, i); } + LongMaxShuffle shuffleFromArray(int[] indices, int i) { return new LongMaxShuffle(indices, i); } @Override @ForceInline @@ -352,9 +343,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(LongMaxShuffle.class); // specialize + public final LongMaxShuffle toShuffle() { + return (LongMaxShuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -781,23 +779,26 @@ static final class LongMaxShuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = long.class; // used by the JVM - LongMaxShuffle(byte[] reorder) { - super(VLENGTH, reorder); + LongMaxShuffle(long[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public LongMaxShuffle(int[] reorder) { - super(VLENGTH, reorder); + LongMaxShuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public LongMaxShuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + LongMaxShuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public LongMaxShuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + long[] indices() { + return (long[])getPayload(); } @Override + @ForceInline public LongSpecies vspecies() { return VSPECIES; } @@ -805,47 +806,122 @@ public LongSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Long.MAX_VALUE); + assert(Long.MIN_VALUE <= -VLENGTH); } static final LongMaxShuffle IOTA = new LongMaxShuffle(IDENTITY); @Override @ForceInline public LongMaxVector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, LongMaxShuffle.class, this, VLENGTH, - (s) -> ((LongMaxVector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + LongMaxVector toBitsVector() { + return (LongMaxVector) super.toBitsVectorTemplate(); + } + + @Override + LongMaxVector toBitsVector0() { + return ((LongMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + } + + @Override + @ForceInline + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } @Override @ForceInline - public LongMaxShuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, LongMaxShuffle.class, this, VLENGTH, - (s) -> ((LongMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public void intoArray(int[] a, int offset) { + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } + } + + @Override + @ForceInline + public final LongMaxMask laneIsValid() { + return (LongMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final LongMaxShuffle rearrange(VectorShuffle shuffle) { + LongMaxShuffle concreteShuffle = (LongMaxShuffle) shuffle; + return (LongMaxShuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); } @ForceInline @Override - public LongMaxShuffle rearrange(VectorShuffle shuffle) { - LongMaxShuffle s = (LongMaxShuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final LongMaxShuffle wrapIndexes() { + LongMaxVector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (LongMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (LongMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (LongMaxShuffle) v.toShuffle(vspecies(), false); + } + + private static long[] prepare(int[] indices, int offset) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static long[] prepare(IntUnaryOperator f) { + long[] a = new long[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (long)si; + } + return a; + } + + private static boolean indicesInRange(long[] indices) { + int length = indices.length; + for (long si : indices) { + if (si >= (long)length || si < (long)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new LongMaxShuffle(r); + return true; } } 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 43fedc2693b23..cde68c8fb3863 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 @@ -1012,7 +1012,7 @@ private static VectorBroadcastIntOp> broadcastIntOp // and broadcast, but it would be more surprising not to continue // the obvious pattern started by unary and binary. - /** + /** * {@inheritDoc} * @see #lanewise(VectorOperators.Ternary,long,long,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,long,VectorMask) @@ -2159,9 +2159,10 @@ LongVector sliceTemplate(int origin, Vector v1) { LongVector that = (LongVector) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((long)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = broadcast((long)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2189,9 +2190,10 @@ LongVector slice(int origin, @ForceInline LongVector sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((long)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = broadcast((long)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2210,10 +2212,10 @@ LongVector sliceTemplate(int origin) { LongVector that = (LongVector) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast((long)(origin)))); - iota = iotaShuffle(-origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = broadcast((long)origin); + VectorMask blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2250,10 +2252,10 @@ LongVector sliceTemplate(int origin) { LongVector unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast((long)(origin)))); - iota = iotaShuffle(-origin, 1, true); + LongVector iotaVector = (LongVector) iotaShuffle().toBitsVector(); + LongVector filter = broadcast((long)origin); + VectorMask blendMask = iotaVector.compare(VectorOperators.GE, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2276,13 +2278,11 @@ LongVector sliceTemplate(int origin) { final > LongVector rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, long.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2305,13 +2305,11 @@ LongVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, long.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2332,30 +2330,29 @@ LongVector rearrangeTemplate(Class shuffletype, S shuffle, LongVector v) { VectorMask valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); LongVector r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, long.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); LongVector r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, long.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle toShuffle0(LongSpecies dsp) { + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { + assert(dsp.length() == vspecies().length()); long[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { @@ -2364,16 +2361,18 @@ VectorShuffle toShuffle0(LongSpecies dsp) { return VectorShuffle.fromArray(dsp, sa, 0); } - /*package-private*/ @ForceInline - final - VectorShuffle toShuffleTemplate(Class shuffleType) { - LongSpecies vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), long.class, length(), - shuffleType, byte.class, length(), - this, vsp, - LongVector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); + LongVector idx = this; + LongVector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + LongVector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -3784,9 +3783,10 @@ static final class LongSpecies extends AbstractSpecies { private LongSpecies(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of(long.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == Long.SIZE); } @@ -4063,6 +4063,7 @@ static LongSpecies species(VectorShape s) { = new LongSpecies(VectorShape.S_64_BIT, Long64Vector.class, Long64Vector.Long64Mask.class, + Long64Vector.Long64Shuffle.class, Long64Vector::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -4070,6 +4071,7 @@ static LongSpecies species(VectorShape s) { = new LongSpecies(VectorShape.S_128_BIT, Long128Vector.class, Long128Vector.Long128Mask.class, + Long128Vector.Long128Shuffle.class, Long128Vector::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -4077,6 +4079,7 @@ static LongSpecies species(VectorShape s) { = new LongSpecies(VectorShape.S_256_BIT, Long256Vector.class, Long256Vector.Long256Mask.class, + Long256Vector.Long256Shuffle.class, Long256Vector::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -4084,6 +4087,7 @@ static LongSpecies species(VectorShape s) { = new LongSpecies(VectorShape.S_512_BIT, Long512Vector.class, Long512Vector.Long512Mask.class, + Long512Vector.Long512Shuffle.class, Long512Vector::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -4091,6 +4095,7 @@ static LongSpecies species(VectorShape s) { = new LongSpecies(VectorShape.S_Max_BIT, LongMaxVector.class, LongMaxVector.LongMaxMask.class, + LongMaxVector.LongMaxShuffle.class, LongMaxVector::new); /** diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java index b013e4b282586..17ec4f72d2e16 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java @@ -141,24 +141,15 @@ Short128Mask maskFromArray(boolean[] bits) { @ForceInline Short128Shuffle iotaShuffle() { return Short128Shuffle.IOTA; } + @Override @ForceInline Short128Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Short128Shuffle)VectorSupport.shuffleIota(ETYPE, Short128Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Short128Shuffle)VectorSupport.shuffleIota(ETYPE, Short128Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Short128Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short128Shuffle shuffleFromBytes(byte[] reorder) { return new Short128Shuffle(reorder); } - - @Override - @ForceInline - Short128Shuffle shuffleFromArray(int[] indexes, int i) { return new Short128Shuffle(indexes, i); } + Short128Shuffle shuffleFromArray(int[] indices, int i) { return new Short128Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Short128Shuffle.class); // specialize + public final Short128Shuffle toShuffle() { + return (Short128Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -805,23 +803,26 @@ static final class Short128Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = short.class; // used by the JVM - Short128Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Short128Shuffle(short[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Short128Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Short128Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Short128Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Short128Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Short128Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + short[] indices() { + return (short[])getPayload(); } @Override + @ForceInline public ShortSpecies vspecies() { return VSPECIES; } @@ -829,47 +830,105 @@ public ShortSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Short.MAX_VALUE); + assert(Short.MIN_VALUE <= -VLENGTH); } static final Short128Shuffle IOTA = new Short128Shuffle(IDENTITY); @Override @ForceInline public Short128Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Short128Shuffle.class, this, VLENGTH, - (s) -> ((Short128Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Short128Vector toBitsVector() { + return (Short128Vector) super.toBitsVectorTemplate(); + } + + @Override + Short128Vector toBitsVector0() { + return ((Short128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Short128Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Short128Shuffle.class, this, VLENGTH, - (s) -> ((Short128Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + VectorSpecies species = IntVector.SPECIES_128; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.S2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.S2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); + } + @Override - public Short128Shuffle rearrange(VectorShuffle shuffle) { - Short128Shuffle s = (Short128Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Short128Mask laneIsValid() { + return (Short128Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Short128Shuffle rearrange(VectorShuffle shuffle) { + Short128Shuffle concreteShuffle = (Short128Shuffle) shuffle; + return (Short128Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Short128Shuffle wrapIndexes() { + Short128Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Short128Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Short128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Short128Shuffle) v.toShuffle(vspecies(), false); + } + + private static short[] prepare(int[] indices, int offset) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static short[] prepare(IntUnaryOperator f) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static boolean indicesInRange(short[] indices) { + int length = indices.length; + for (short si : indices) { + if (si >= (short)length || si < (short)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Short128Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java index af4c862eaf3b6..e7505779f18b1 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java @@ -141,24 +141,15 @@ Short256Mask maskFromArray(boolean[] bits) { @ForceInline Short256Shuffle iotaShuffle() { return Short256Shuffle.IOTA; } + @Override @ForceInline Short256Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Short256Shuffle)VectorSupport.shuffleIota(ETYPE, Short256Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Short256Shuffle)VectorSupport.shuffleIota(ETYPE, Short256Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Short256Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short256Shuffle shuffleFromBytes(byte[] reorder) { return new Short256Shuffle(reorder); } - - @Override - @ForceInline - Short256Shuffle shuffleFromArray(int[] indexes, int i) { return new Short256Shuffle(indexes, i); } + Short256Shuffle shuffleFromArray(int[] indices, int i) { return new Short256Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Short256Shuffle.class); // specialize + public final Short256Shuffle toShuffle() { + return (Short256Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -821,23 +819,26 @@ static final class Short256Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = short.class; // used by the JVM - Short256Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Short256Shuffle(short[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Short256Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Short256Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Short256Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Short256Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Short256Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + short[] indices() { + return (short[])getPayload(); } @Override + @ForceInline public ShortSpecies vspecies() { return VSPECIES; } @@ -845,47 +846,105 @@ public ShortSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Short.MAX_VALUE); + assert(Short.MIN_VALUE <= -VLENGTH); } static final Short256Shuffle IOTA = new Short256Shuffle(IDENTITY); @Override @ForceInline public Short256Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Short256Shuffle.class, this, VLENGTH, - (s) -> ((Short256Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Short256Vector toBitsVector() { + return (Short256Vector) super.toBitsVectorTemplate(); + } + + @Override + Short256Vector toBitsVector0() { + return ((Short256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Short256Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Short256Shuffle.class, this, VLENGTH, - (s) -> ((Short256Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + VectorSpecies species = IntVector.SPECIES_256; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.S2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.S2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); + } + @Override - public Short256Shuffle rearrange(VectorShuffle shuffle) { - Short256Shuffle s = (Short256Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Short256Mask laneIsValid() { + return (Short256Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Short256Shuffle rearrange(VectorShuffle shuffle) { + Short256Shuffle concreteShuffle = (Short256Shuffle) shuffle; + return (Short256Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Short256Shuffle wrapIndexes() { + Short256Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Short256Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Short256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Short256Shuffle) v.toShuffle(vspecies(), false); + } + + private static short[] prepare(int[] indices, int offset) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static short[] prepare(IntUnaryOperator f) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static boolean indicesInRange(short[] indices) { + int length = indices.length; + for (short si : indices) { + if (si >= (short)length || si < (short)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Short256Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java index 3bb019f3b7cbf..7ca0d00b37ad0 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java @@ -141,24 +141,15 @@ Short512Mask maskFromArray(boolean[] bits) { @ForceInline Short512Shuffle iotaShuffle() { return Short512Shuffle.IOTA; } + @Override @ForceInline Short512Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Short512Shuffle)VectorSupport.shuffleIota(ETYPE, Short512Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Short512Shuffle)VectorSupport.shuffleIota(ETYPE, Short512Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Short512Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short512Shuffle shuffleFromBytes(byte[] reorder) { return new Short512Shuffle(reorder); } - - @Override - @ForceInline - Short512Shuffle shuffleFromArray(int[] indexes, int i) { return new Short512Shuffle(indexes, i); } + Short512Shuffle shuffleFromArray(int[] indices, int i) { return new Short512Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Short512Shuffle.class); // specialize + public final Short512Shuffle toShuffle() { + return (Short512Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -853,23 +851,26 @@ static final class Short512Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = short.class; // used by the JVM - Short512Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Short512Shuffle(short[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Short512Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Short512Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Short512Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Short512Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Short512Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + short[] indices() { + return (short[])getPayload(); } @Override + @ForceInline public ShortSpecies vspecies() { return VSPECIES; } @@ -877,47 +878,105 @@ public ShortSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Short.MAX_VALUE); + assert(Short.MIN_VALUE <= -VLENGTH); } static final Short512Shuffle IOTA = new Short512Shuffle(IDENTITY); @Override @ForceInline public Short512Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Short512Shuffle.class, this, VLENGTH, - (s) -> ((Short512Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Short512Vector toBitsVector() { + return (Short512Vector) super.toBitsVectorTemplate(); + } + + @Override + Short512Vector toBitsVector0() { + return ((Short512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Short512Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Short512Shuffle.class, this, VLENGTH, - (s) -> ((Short512Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + VectorSpecies species = IntVector.SPECIES_512; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.S2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.S2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); + } + @Override - public Short512Shuffle rearrange(VectorShuffle shuffle) { - Short512Shuffle s = (Short512Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Short512Mask laneIsValid() { + return (Short512Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Short512Shuffle rearrange(VectorShuffle shuffle) { + Short512Shuffle concreteShuffle = (Short512Shuffle) shuffle; + return (Short512Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Short512Shuffle wrapIndexes() { + Short512Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Short512Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Short512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Short512Shuffle) v.toShuffle(vspecies(), false); + } + + private static short[] prepare(int[] indices, int offset) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static short[] prepare(IntUnaryOperator f) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static boolean indicesInRange(short[] indices) { + int length = indices.length; + for (short si : indices) { + if (si >= (short)length || si < (short)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Short512Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java index 905e313e95c1c..4837bd3d687fe 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java @@ -141,24 +141,15 @@ Short64Mask maskFromArray(boolean[] bits) { @ForceInline Short64Shuffle iotaShuffle() { return Short64Shuffle.IOTA; } + @Override @ForceInline Short64Shuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (Short64Shuffle)VectorSupport.shuffleIota(ETYPE, Short64Shuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (Short64Shuffle)VectorSupport.shuffleIota(ETYPE, Short64Shuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (Short64Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short64Shuffle shuffleFromBytes(byte[] reorder) { return new Short64Shuffle(reorder); } - - @Override - @ForceInline - Short64Shuffle shuffleFromArray(int[] indexes, int i) { return new Short64Shuffle(indexes, i); } + Short64Shuffle shuffleFromArray(int[] indices, int i) { return new Short64Shuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(Short64Shuffle.class); // specialize + public final Short64Shuffle toShuffle() { + return (Short64Shuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -797,23 +795,26 @@ static final class Short64Shuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = short.class; // used by the JVM - Short64Shuffle(byte[] reorder) { - super(VLENGTH, reorder); + Short64Shuffle(short[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public Short64Shuffle(int[] reorder) { - super(VLENGTH, reorder); + Short64Shuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public Short64Shuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + Short64Shuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public Short64Shuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + short[] indices() { + return (short[])getPayload(); } @Override + @ForceInline public ShortSpecies vspecies() { return VSPECIES; } @@ -821,47 +822,105 @@ public ShortSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Short.MAX_VALUE); + assert(Short.MIN_VALUE <= -VLENGTH); } static final Short64Shuffle IOTA = new Short64Shuffle(IDENTITY); @Override @ForceInline public Short64Vector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, Short64Shuffle.class, this, VLENGTH, - (s) -> ((Short64Vector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + Short64Vector toBitsVector() { + return (Short64Vector) super.toBitsVectorTemplate(); + } + + @Override + Short64Vector toBitsVector0() { + return ((Short64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public Short64Shuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, Short64Shuffle.class, this, VLENGTH, - (s) -> ((Short64Shuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + VectorSpecies species = IntVector.SPECIES_64; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.S2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.S2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); + } + @Override - public Short64Shuffle rearrange(VectorShuffle shuffle) { - Short64Shuffle s = (Short64Shuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final Short64Mask laneIsValid() { + return (Short64Mask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final Short64Shuffle rearrange(VectorShuffle shuffle) { + Short64Shuffle concreteShuffle = (Short64Shuffle) shuffle; + return (Short64Shuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final Short64Shuffle wrapIndexes() { + Short64Vector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (Short64Vector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (Short64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (Short64Shuffle) v.toShuffle(vspecies(), false); + } + + private static short[] prepare(int[] indices, int offset) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static short[] prepare(IntUnaryOperator f) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static boolean indicesInRange(short[] indices) { + int length = indices.length; + for (short si : indices) { + if (si >= (short)length || si < (short)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new Short64Shuffle(r); + return true; } } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java index 5bb1beee6edd2..9b90756c8265a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java @@ -141,24 +141,15 @@ ShortMaxMask maskFromArray(boolean[] bits) { @ForceInline ShortMaxShuffle iotaShuffle() { return ShortMaxShuffle.IOTA; } + @Override @ForceInline ShortMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return (ShortMaxShuffle)VectorSupport.shuffleIota(ETYPE, ShortMaxShuffle.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return (ShortMaxShuffle)VectorSupport.shuffleIota(ETYPE, ShortMaxShuffle.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } + return (ShortMaxShuffle) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - ShortMaxShuffle shuffleFromBytes(byte[] reorder) { return new ShortMaxShuffle(reorder); } - - @Override - @ForceInline - ShortMaxShuffle shuffleFromArray(int[] indexes, int i) { return new ShortMaxShuffle(indexes, i); } + ShortMaxShuffle shuffleFromArray(int[] indices, int i) { return new ShortMaxShuffle(indices, i); } @Override @ForceInline @@ -357,9 +348,16 @@ public final long reduceLanesToLong(VectorOperators.Associative op, return (long) super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized } + @Override + @ForceInline + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { + return bitsToShuffleTemplate(dsp); + } + + @Override @ForceInline - public VectorShuffle toShuffle() { - return super.toShuffleTemplate(ShortMaxShuffle.class); // specialize + public final ShortMaxShuffle toShuffle() { + return (ShortMaxShuffle) toShuffle(vspecies(), false); } // Specialized unary testing @@ -791,23 +789,26 @@ static final class ShortMaxShuffle extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM static final Class ETYPE = short.class; // used by the JVM - ShortMaxShuffle(byte[] reorder) { - super(VLENGTH, reorder); + ShortMaxShuffle(short[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public ShortMaxShuffle(int[] reorder) { - super(VLENGTH, reorder); + ShortMaxShuffle(int[] indices, int i) { + this(prepare(indices, i)); } - public ShortMaxShuffle(int[] reorder, int i) { - super(VLENGTH, reorder, i); + ShortMaxShuffle(IntUnaryOperator fn) { + this(prepare(fn)); } - public ShortMaxShuffle(IntUnaryOperator fn) { - super(VLENGTH, fn); + short[] indices() { + return (short[])getPayload(); } @Override + @ForceInline public ShortSpecies vspecies() { return VSPECIES; } @@ -815,47 +816,105 @@ public ShortSpecies vspecies() { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < Short.MAX_VALUE); + assert(Short.MIN_VALUE <= -VLENGTH); } static final ShortMaxShuffle IOTA = new ShortMaxShuffle(IDENTITY); @Override @ForceInline public ShortMaxVector toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, ShortMaxShuffle.class, this, VLENGTH, - (s) -> ((ShortMaxVector)(((AbstractShuffle)(s)).toVectorTemplate()))); + return toBitsVector(); } @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + ShortMaxVector toBitsVector() { + return (ShortMaxVector) super.toBitsVectorTemplate(); + } + + @Override + ShortMaxVector toBitsVector0() { + return ((ShortMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public ShortMaxShuffle wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, ShortMaxShuffle.class, this, VLENGTH, - (s) -> ((ShortMaxShuffle)(((AbstractShuffle)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); } + @Override @ForceInline + public void intoArray(int[] a, int offset) { + VectorSpecies species = IntVector.SPECIES_MAX; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.S2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.S2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); + } + @Override - public ShortMaxShuffle rearrange(VectorShuffle shuffle) { - ShortMaxShuffle s = (ShortMaxShuffle) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + @ForceInline + public final ShortMaxMask laneIsValid() { + return (ShortMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); + } + + @ForceInline + @Override + public final ShortMaxShuffle rearrange(VectorShuffle shuffle) { + ShortMaxShuffle concreteShuffle = (ShortMaxShuffle) shuffle; + return (ShortMaxShuffle) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); + } + + @ForceInline + @Override + public final ShortMaxShuffle wrapIndexes() { + ShortMaxVector v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = (ShortMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = (ShortMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return (ShortMaxShuffle) v.toShuffle(vspecies(), false); + } + + private static short[] prepare(int[] indices, int offset) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static short[] prepare(IntUnaryOperator f) { + short[] a = new short[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = (short)si; + } + return a; + } + + private static boolean indicesInRange(short[] indices) { + int length = indices.length; + for (short si : indices) { + if (si >= (short)length || si < (short)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new ShortMaxShuffle(r); + return true; } } 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 552967d82e70d..3cf848f31d0b6 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 @@ -1096,7 +1096,7 @@ private static VectorBroadcastIntOp> broadcastInt // and broadcast, but it would be more surprising not to continue // the obvious pattern started by unary and binary. - /** + /** * {@inheritDoc} * @see #lanewise(VectorOperators.Ternary,short,short,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,short,VectorMask) @@ -2309,9 +2309,10 @@ ShortVector sliceTemplate(int origin, Vector v1) { ShortVector that = (ShortVector) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((short)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + ShortVector iotaVector = (ShortVector) iotaShuffle().toBitsVector(); + ShortVector filter = broadcast((short)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2339,9 +2340,10 @@ ShortVector slice(int origin, @ForceInline ShortVector sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast((short)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + ShortVector iotaVector = (ShortVector) iotaShuffle().toBitsVector(); + ShortVector filter = broadcast((short)(length() - origin)); + VectorMask blendMask = iotaVector.compare(VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2360,10 +2362,10 @@ ShortVector sliceTemplate(int origin) { ShortVector that = (ShortVector) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast((short)(origin)))); - iota = iotaShuffle(-origin, 1, true); + ShortVector iotaVector = (ShortVector) iotaShuffle().toBitsVector(); + ShortVector filter = broadcast((short)origin); + VectorMask blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2400,10 +2402,10 @@ ShortVector sliceTemplate(int origin) { ShortVector unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle iota = iotaShuffle(); - VectorMask blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast((short)(origin)))); - iota = iotaShuffle(-origin, 1, true); + ShortVector iotaVector = (ShortVector) iotaShuffle().toBitsVector(); + ShortVector filter = broadcast((short)origin); + VectorMask blendMask = iotaVector.compare(VectorOperators.GE, filter); + AbstractShuffle iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2426,13 +2428,11 @@ ShortVector sliceTemplate(int origin) { final > ShortVector rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, short.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2455,13 +2455,11 @@ ShortVector rearrangeTemplate(Class shuffletype, M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, short.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2482,30 +2480,29 @@ ShortVector rearrangeTemplate(Class shuffletype, S shuffle, ShortVector v) { VectorMask valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); ShortVector r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, short.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); ShortVector r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, short.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle toShuffle0(ShortSpecies dsp) { + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { + assert(dsp.length() == vspecies().length()); short[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { @@ -2514,16 +2511,18 @@ VectorShuffle toShuffle0(ShortSpecies dsp) { return VectorShuffle.fromArray(dsp, sa, 0); } - /*package-private*/ @ForceInline - final - VectorShuffle toShuffleTemplate(Class shuffleType) { - ShortSpecies vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), short.class, length(), - shuffleType, byte.class, length(), - this, vsp, - ShortVector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); + ShortVector idx = this; + ShortVector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + ShortVector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -4210,9 +4209,10 @@ static final class ShortSpecies extends AbstractSpecies { private ShortSpecies(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of(short.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == Short.SIZE); } @@ -4498,6 +4498,7 @@ static ShortSpecies species(VectorShape s) { = new ShortSpecies(VectorShape.S_64_BIT, Short64Vector.class, Short64Vector.Short64Mask.class, + Short64Vector.Short64Shuffle.class, Short64Vector::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -4505,6 +4506,7 @@ static ShortSpecies species(VectorShape s) { = new ShortSpecies(VectorShape.S_128_BIT, Short128Vector.class, Short128Vector.Short128Mask.class, + Short128Vector.Short128Shuffle.class, Short128Vector::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -4512,6 +4514,7 @@ static ShortSpecies species(VectorShape s) { = new ShortSpecies(VectorShape.S_256_BIT, Short256Vector.class, Short256Vector.Short256Mask.class, + Short256Vector.Short256Shuffle.class, Short256Vector::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -4519,6 +4522,7 @@ static ShortSpecies species(VectorShape s) { = new ShortSpecies(VectorShape.S_512_BIT, Short512Vector.class, Short512Vector.Short512Mask.class, + Short512Vector.Short512Shuffle.class, Short512Vector::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -4526,6 +4530,7 @@ static ShortSpecies species(VectorShape s) { = new ShortSpecies(VectorShape.S_Max_BIT, ShortMaxVector.class, ShortMaxVector.ShortMaxMask.class, + ShortMaxVector.ShortMaxShuffle.class, ShortMaxVector::new); /** diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java index 5b6dd3d09ac10..76d6392e48a3a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java index 1ffbcef821afb..89e0d38bcb06c 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, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,6 +124,7 @@ VectorSpecies withLanes(Class elementType) { * @throws IllegalArgumentException if no such vector shape exists * @see #vectorBitSize() */ + @ForceInline public static VectorShape forBitSize(int bitSize) { switch (bitSize) { case 64: diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShuffle.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShuffle.java index b046874c39052..bc1780a81acc0 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShuffle.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShuffle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,8 +133,8 @@ */ @SuppressWarnings("exports") public abstract class VectorShuffle extends jdk.internal.vm.vector.VectorSupport.VectorShuffle { - VectorShuffle(byte[] reorder) { - super(reorder); + VectorShuffle(Object indices) { + super(indices); } /** @@ -556,7 +556,7 @@ private static int unzipIndex(int i, int vlen, int part) { * @param i the lane index * @return the {@code int} lane element at lane index {@code i} */ - public int laneSource(int i) { return toArray()[i]; } + public abstract int laneSource(int i); /** * Rearranges the lane elements of this shuffle selecting lane indexes diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java index 6cfe5f6d9d93e..03cb0ae559e70 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,8 @@ */ package jdk.incubator.vector; +import jdk.internal.vm.annotation.ForceInline; + import java.lang.foreign.MemorySegment; import java.nio.ByteOrder; @@ -342,6 +344,7 @@ public interface VectorSpecies { * @see #withLanes(Class) * @see #withShape(VectorShape) */ + @ForceInline static VectorSpecies of(Class elementType, VectorShape shape) { LaneType laneType = LaneType.of(elementType); return AbstractSpecies.findSpecies(elementType, laneType, shape); @@ -367,6 +370,7 @@ static VectorSpecies of(Class elementType, VectorShape shape) { * or if the given type is not a valid {@code ETYPE} * @see VectorSpecies#ofPreferred(Class) */ + @ForceInline static VectorSpecies ofLargestShape(Class etype) { return VectorSpecies.of(etype, VectorShape.largestShapeFor(etype)); } @@ -410,6 +414,7 @@ static VectorSpecies ofLargestShape(Class etype) { * @see VectorShape#preferredShape() * @see VectorSpecies#ofLargestShape(Class) */ + @ForceInline public static VectorSpecies ofPreferred(Class etype) { return of(etype, VectorShape.preferredShape()); } @@ -432,6 +437,7 @@ public static VectorSpecies ofPreferred(Class etype) { * if the given {@code elementType} argument is not * a valid vector {@code ETYPE} */ + @ForceInline static int elementSize(Class elementType) { return LaneType.of(elementType).elementSize; } 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 7eb1d9810b1e9..835868e61cd78 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 @@ -1229,7 +1229,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // and broadcast, but it would be more surprising not to continue // the obvious pattern started by unary and binary. - /** + /** * {@inheritDoc} * @see #lanewise(VectorOperators.Ternary,$type$,$type$,VectorMask) * @see #lanewise(VectorOperators.Ternary,Vector,$type$,VectorMask) @@ -2685,9 +2685,15 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ that = ($abstractvectortype$) v1; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle<$Boxtype$> iota = iotaShuffle(); - VectorMask<$Boxtype$> blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast(($type$)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + $Bitstype$Vector iotaVector = ($Bitstype$Vector) iotaShuffle().toBitsVector(); +#if[FP] + $Bitstype$Vector filter = $Bitstype$Vector.broadcast(($Bitstype$Vector.$Bitstype$Species) vspecies().asIntegral(), ($bitstype$)(length() - origin)); + VectorMask<$Boxtype$> blendMask = iotaVector.compare(VectorOperators.LT, filter).cast(vspecies()); +#else[FP] + $abstractvectortype$ filter = broadcast(($type$)(length() - origin)); + VectorMask<$Boxtype$> blendMask = iotaVector.compare(VectorOperators.LT, filter); +#end[FP] + AbstractShuffle<$Boxtype$> iota = iotaShuffle(origin, 1, true); return that.rearrange(iota).blend(this.rearrange(iota), blendMask); } @@ -2715,9 +2721,15 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @ForceInline $abstractvectortype$ sliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle<$Boxtype$> iota = iotaShuffle(); - VectorMask<$Boxtype$> blendMask = iota.toVector().compare(VectorOperators.LT, (broadcast(($type$)(length() - origin)))); - iota = iotaShuffle(origin, 1, true); + $Bitstype$Vector iotaVector = ($Bitstype$Vector) iotaShuffle().toBitsVector(); +#if[FP] + $Bitstype$Vector filter = $Bitstype$Vector.broadcast(($Bitstype$Vector.$Bitstype$Species) vspecies().asIntegral(), ($bitstype$)(length() - origin)); + VectorMask<$Boxtype$> blendMask = iotaVector.compare(VectorOperators.LT, filter).cast(vspecies()); +#else[FP] + $abstractvectortype$ filter = broadcast(($type$)(length() - origin)); + VectorMask<$Boxtype$> blendMask = iotaVector.compare(VectorOperators.LT, filter); +#end[FP] + AbstractShuffle<$Boxtype$> iota = iotaShuffle(origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2736,10 +2748,15 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ that = ($abstractvectortype$) w; that.check(this); Objects.checkIndex(origin, length() + 1); - VectorShuffle<$Boxtype$> iota = iotaShuffle(); - VectorMask<$Boxtype$> blendMask = iota.toVector().compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, - (broadcast(($type$)(origin)))); - iota = iotaShuffle(-origin, 1, true); + $Bitstype$Vector iotaVector = ($Bitstype$Vector) iotaShuffle().toBitsVector(); +#if[FP] + $Bitstype$Vector filter = $Bitstype$Vector.broadcast(($Bitstype$Vector.$Bitstype$Species) vspecies().asIntegral(), ($bitstype$)origin); + VectorMask<$Boxtype$> blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter).cast(vspecies()); +#else[FP] + $abstractvectortype$ filter = broadcast(($type$)origin); + VectorMask<$Boxtype$> blendMask = iotaVector.compare((part == 0) ? VectorOperators.GE : VectorOperators.LT, filter); +#end[FP] + AbstractShuffle<$Boxtype$> iota = iotaShuffle(-origin, 1, true); return that.blend(this.rearrange(iota), blendMask); } @@ -2776,10 +2793,15 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ unsliceTemplate(int origin) { Objects.checkIndex(origin, length() + 1); - VectorShuffle<$Boxtype$> iota = iotaShuffle(); - VectorMask<$Boxtype$> blendMask = iota.toVector().compare(VectorOperators.GE, - (broadcast(($type$)(origin)))); - iota = iotaShuffle(-origin, 1, true); + $Bitstype$Vector iotaVector = ($Bitstype$Vector) iotaShuffle().toBitsVector(); +#if[FP] + $Bitstype$Vector filter = $Bitstype$Vector.broadcast(($Bitstype$Vector.$Bitstype$Species) vspecies().asIntegral(), ($bitstype$)origin); + VectorMask<$Boxtype$> blendMask = iotaVector.compare(VectorOperators.GE, filter).cast(vspecies()); +#else[FP] + $abstractvectortype$ filter = broadcast(($type$)origin); + VectorMask<$Boxtype$> blendMask = iotaVector.compare(VectorOperators.GE, filter); +#end[FP] + AbstractShuffle<$Boxtype$> iota = iotaShuffle(-origin, 1, true); return vspecies().zero().blend(this.rearrange(iota), blendMask); } @@ -2802,13 +2824,11 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { final > $abstractvectortype$ rearrangeTemplate(Class shuffletype, S shuffle) { - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, null, $type$.class, length(), - this, ws, null, + this, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); } @@ -2831,13 +2851,11 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { M m) { m.check(masktype, this); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); return VectorSupport.rearrangeOp( getClass(), shuffletype, masktype, $type$.class, length(), - this, ws, m, + this, shuffle, m, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return !m_.laneIsSet(i) ? 0 : v1.lane(ei); })); } @@ -2858,48 +2876,61 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { S shuffle, $abstractvectortype$ v) { VectorMask<$Boxtype$> valid = shuffle.laneIsValid(); - @SuppressWarnings("unchecked") - S ws = (S) shuffle.wrapIndexes(); $abstractvectortype$ r0 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, $type$.class, length(), - this, ws, null, + this, shuffle, null, (v0, s_, m_) -> v0.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v0.length()); return v0.lane(ei); })); $abstractvectortype$ r1 = VectorSupport.rearrangeOp( getClass(), shuffletype, null, $type$.class, length(), - v, ws, null, + v, shuffle, null, (v1, s_, m_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); + int ei = Integer.remainderUnsigned(s_.laneSource(i), v1.length()); return v1.lane(ei); })); return r1.blend(r0, valid); } + @Override @ForceInline - private final - VectorShuffle<$Boxtype$> toShuffle0($Type$Species dsp) { + final VectorShuffle bitsToShuffle0(AbstractSpecies dsp) { +#if[FP] + throw new AssertionError(); +#else[FP] + assert(dsp.length() == vspecies().length()); $type$[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { sa[i] = (int) a[i]; } return VectorShuffle.fromArray(dsp, sa, 0); +#end[FP] } - /*package-private*/ @ForceInline - final - VectorShuffle<$Boxtype$> toShuffleTemplate(Class shuffleType) { - $Type$Species vsp = vspecies(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, - getClass(), $type$.class, length(), - shuffleType, byte.class, length(), - this, vsp, - $Type$Vector::toShuffle0); + final + VectorShuffle toShuffle(AbstractSpecies dsp, boolean wrap) { + assert(dsp.elementSize() == vspecies().elementSize()); +#if[float] + IntVector idx = convert(VectorOperators.F2I, 0).reinterpretAsInts(); +#end[float] +#if[double] + LongVector idx = convert(VectorOperators.D2L, 0).reinterpretAsLongs(); +#end[double] +#if[!FP] + $Type$Vector idx = this; +#end[!FP] + $Bitstype$Vector wrapped = idx.lanewise(VectorOperators.AND, length() - 1); + if (!wrap) { + $Bitstype$Vector wrappedEx = wrapped.lanewise(VectorOperators.SUB, length()); + VectorMask<$Boxbitstype$> inBound = wrapped.compare(VectorOperators.EQ, idx); + wrapped = wrappedEx.blend(wrapped, inBound); + } + return wrapped.bitsToShuffle(dsp); } /** @@ -5447,9 +5478,10 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { private $Type$Species(VectorShape shape, Class vectorType, Class> maskType, + Class> shuffleType, Function vectorFactory) { super(shape, LaneType.of($type$.class), - vectorType, maskType, + vectorType, maskType, shuffleType, vectorFactory); assert(this.elementSize() == $Boxtype$.SIZE); } @@ -5742,6 +5774,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { = new $Type$Species(VectorShape.S_64_BIT, $Type$64Vector.class, $Type$64Vector.$Type$64Mask.class, + $Type$64Vector.$Type$64Shuffle.class, $Type$64Vector::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ @@ -5749,6 +5782,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { = new $Type$Species(VectorShape.S_128_BIT, $Type$128Vector.class, $Type$128Vector.$Type$128Mask.class, + $Type$128Vector.$Type$128Shuffle.class, $Type$128Vector::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ @@ -5756,6 +5790,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { = new $Type$Species(VectorShape.S_256_BIT, $Type$256Vector.class, $Type$256Vector.$Type$256Mask.class, + $Type$256Vector.$Type$256Shuffle.class, $Type$256Vector::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ @@ -5763,6 +5798,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { = new $Type$Species(VectorShape.S_512_BIT, $Type$512Vector.class, $Type$512Vector.$Type$512Mask.class, + $Type$512Vector.$Type$512Shuffle.class, $Type$512Vector::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ @@ -5770,6 +5806,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { = new $Type$Species(VectorShape.S_Max_BIT, $Type$MaxVector.class, $Type$MaxVector.$Type$MaxMask.class, + $Type$MaxVector.$Type$MaxShuffle.class, $Type$MaxVector::new); /** 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 9752a795ea79d..216f28fde87c9 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 @@ -143,24 +143,23 @@ final class $vectortype$ extends $abstractvectortype$ { @ForceInline $shuffletype$ iotaShuffle() { return $shuffletype$.IOTA; } + @Override @ForceInline $shuffletype$ iotaShuffle(int start, int step, boolean wrap) { - if (wrap) { - return ($shuffletype$)VectorSupport.shuffleIota(ETYPE, $shuffletype$.class, VSPECIES, VLENGTH, start, step, 1, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (VectorIntrinsics.wrapToRange(i*lstep + lstart, l)))); - } else { - return ($shuffletype$)VectorSupport.shuffleIota(ETYPE, $shuffletype$.class, VSPECIES, VLENGTH, start, step, 0, - (l, lstart, lstep, s) -> s.shuffleFromOp(i -> (i*lstep + lstart))); - } +#if[byte] + return ($shuffletype$) iotaShuffleTemplate((byte) start, (byte) step, wrap); +#end[byte] +#if[short] + return ($shuffletype$) iotaShuffleTemplate((short) start, (short) step, wrap); +#end[short] +#if[!byteOrShort] + return ($shuffletype$) iotaShuffleTemplate(start, step, wrap); +#end[!byteOrShort] } @Override @ForceInline - $shuffletype$ shuffleFromBytes(byte[] reorder) { return new $shuffletype$(reorder); } - - @Override - @ForceInline - $shuffletype$ shuffleFromArray(int[] indexes, int i) { return new $shuffletype$(indexes, i); } + $shuffletype$ shuffleFromArray(int[] indices, int i) { return new $shuffletype$(indices, i); } @Override @ForceInline @@ -361,9 +360,20 @@ final class $vectortype$ extends $abstractvectortype$ { return (long) super.reduceLanesTemplate(op, $masktype$.class, ($masktype$) m); // specialized } + @Override @ForceInline - public VectorShuffle<$Boxtype$> toShuffle() { - return super.toShuffleTemplate($shuffletype$.class); // specialize + final VectorShuffle bitsToShuffle(AbstractSpecies dsp) { +#if[FP] + throw new AssertionError(); +#else[FP] + return bitsToShuffleTemplate(dsp); +#end[FP] + } + + @Override + @ForceInline + public final $shuffletype$ toShuffle() { + return ($shuffletype$) toShuffle(vspecies(), false); } // Specialized unary testing @@ -1077,25 +1087,28 @@ 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<$Boxtype$> ETYPE = $type$.class; // used by the JVM + static final Class<$Boxbitstype$> ETYPE = $bitstype$.class; // used by the JVM - $shuffletype$(byte[] reorder) { - super(VLENGTH, reorder); + $shuffletype$($bitstype$[] indices) { + super(indices); + assert(VLENGTH == indices.length); + assert(indicesInRange(indices)); } - public $shuffletype$(int[] reorder) { - super(VLENGTH, reorder); + $shuffletype$(int[] indices, int i) { + this(prepare(indices, i)); } - public $shuffletype$(int[] reorder, int i) { - super(VLENGTH, reorder, i); + $shuffletype$(IntUnaryOperator fn) { + this(prepare(fn)); } - public $shuffletype$(IntUnaryOperator fn) { - super(VLENGTH, fn); + $bitstype$[] indices() { + return ($bitstype$[])getPayload(); } @Override + @ForceInline public $Type$Species vspecies() { return VSPECIES; } @@ -1103,47 +1116,166 @@ final class $vectortype$ extends $abstractvectortype$ { static { // There must be enough bits in the shuffle lanes to encode // VLENGTH valid indexes and VLENGTH exceptional ones. - assert(VLENGTH < Byte.MAX_VALUE); - assert(Byte.MIN_VALUE <= -VLENGTH); + assert(VLENGTH < $Boxbitstype$.MAX_VALUE); + assert($Boxbitstype$.MIN_VALUE <= -VLENGTH); } static final $shuffletype$ IOTA = new $shuffletype$(IDENTITY); +#if[FP] @Override @ForceInline public $vectortype$ toVector() { - return VectorSupport.shuffleToVector(VCLASS, ETYPE, $shuffletype$.class, this, VLENGTH, - (s) -> (($vectortype$)(((AbstractShuffle<$Boxtype$>)(s)).toVectorTemplate()))); + return ($vectortype$) toBitsVector().castShape(vspecies(), 0); } +#else[FP] + @Override + @ForceInline + public $vectortype$ toVector() { + return toBitsVector(); + } +#end[FP] @Override @ForceInline - public VectorShuffle cast(VectorSpecies s) { - AbstractSpecies species = (AbstractSpecies) s; - if (length() != species.laneCount()) - throw new IllegalArgumentException("VectorShuffle length and species length differ"); - int[] shuffleArray = toArray(); - return s.shuffleFromArray(shuffleArray, 0).check(s); + $bitsvectortype$ toBitsVector() { + return ($bitsvectortype$) super.toBitsVectorTemplate(); + } + + @Override + $bitsvectortype$ toBitsVector0() { + return (($bitsvectortype$) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @ForceInline - public $shuffletype$ wrapIndexes() { - return VectorSupport.wrapShuffleIndexes(ETYPE, $shuffletype$.class, this, VLENGTH, - (s) -> (($shuffletype$)(((AbstractShuffle<$Boxtype$>)(s)).wrapIndexesTemplate()))); + public int laneSource(int i) { + return (int)toBitsVector().lane(i); + } + + @Override + @ForceInline + public void intoArray(int[] a, int offset) { +#if[byte] + VectorSpecies species = IntVector.SPECIES_$BITS$; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.B2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.B2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); + v.convertShape(VectorOperators.B2I, species, 2) + .reinterpretAsInts() + .intoArray(a, offset + species.length() * 2); + v.convertShape(VectorOperators.B2I, species, 3) + .reinterpretAsInts() + .intoArray(a, offset + species.length() * 3); +#end[byte] +#if[short] + VectorSpecies species = IntVector.SPECIES_$BITS$; + Vector v = toBitsVector(); + v.convertShape(VectorOperators.S2I, species, 0) + .reinterpretAsInts() + .intoArray(a, offset); + v.convertShape(VectorOperators.S2I, species, 1) + .reinterpretAsInts() + .intoArray(a, offset + species.length()); +#end[short] +#if[intOrFloat] + toBitsVector().intoArray(a, offset); +#end[intOrFloat] +#if[longOrDouble] + switch (length()) { + case 1 -> a[offset] = laneSource(0); + case 2 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_64, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 4 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_128, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 8 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_256, 0) + .reinterpretAsInts() + .intoArray(a, offset); + case 16 -> toBitsVector() + .convertShape(VectorOperators.L2I, IntVector.SPECIES_512, 0) + .reinterpretAsInts() + .intoArray(a, offset); + default -> { + VectorIntrinsics.checkFromIndexSize(offset, length(), a.length); + for (int i = 0; i < length(); i++) { + a[offset + i] = laneSource(i); + } + } + } +#end[longOrDouble] + } + + @Override + @ForceInline + public final $masktype$ laneIsValid() { + return ($masktype$) toBitsVector().compare(VectorOperators.GE, 0) + .cast(vspecies()); } @ForceInline @Override - public $shuffletype$ rearrange(VectorShuffle<$Boxtype$> shuffle) { - $shuffletype$ s = ($shuffletype$) shuffle; - byte[] reorder1 = reorder(); - byte[] reorder2 = s.reorder(); - byte[] r = new byte[reorder1.length]; - for (int i = 0; i < reorder1.length; i++) { - int ssi = reorder2[i]; - r[i] = reorder1[ssi]; // throws on exceptional index + public final $shuffletype$ rearrange(VectorShuffle<$Boxtype$> shuffle) { + $shuffletype$ concreteShuffle = ($shuffletype$) shuffle; +#if[FP] + return ($shuffletype$) toBitsVector().rearrange(concreteShuffle.cast($Bitstype$Vector.SPECIES_$BITS$)) + .toShuffle(vspecies(), false); +#else[FP] + return ($shuffletype$) toBitsVector().rearrange(concreteShuffle) + .toShuffle(vspecies(), false); +#end[FP] + } + + @ForceInline + @Override + public final $shuffletype$ wrapIndexes() { + $bitsvectortype$ v = toBitsVector(); + if ((length() & (length() - 1)) == 0) { + v = ($bitsvectortype$) v.lanewise(VectorOperators.AND, length() - 1); + } else { + v = ($bitsvectortype$) v.blend(v.lanewise(VectorOperators.ADD, length()), + v.compare(VectorOperators.LT, 0)); + } + return ($shuffletype$) v.toShuffle(vspecies(), false); + } + + private static $bitstype$[] prepare(int[] indices, int offset) { + $bitstype$[] a = new $bitstype$[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = indices[offset + i]; + si = partiallyWrapIndex(si, VLENGTH); + a[i] = ($bitstype$)si; + } + return a; + } + + private static $bitstype$[] prepare(IntUnaryOperator f) { + $bitstype$[] a = new $bitstype$[VLENGTH]; + for (int i = 0; i < VLENGTH; i++) { + int si = f.applyAsInt(i); + si = partiallyWrapIndex(si, VLENGTH); + a[i] = ($bitstype$)si; + } + return a; + } + + private static boolean indicesInRange($bitstype$[] indices) { + int length = indices.length; + for ($bitstype$ si : indices) { + if (si >= ($bitstype$)length || si < ($bitstype$)(-length)) { + String msg = ("index "+si+"out of range ["+length+"] in "+ + java.util.Arrays.toString(indices)); + throw new AssertionError(msg); + } } - return new $shuffletype$(r); + return true; } } diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/resources/aliasmap b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/resources/aliasmap index 001ce5b5cac4d..ecc752e8014a7 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/resources/aliasmap +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/resources/aliasmap @@ -1,6 +1,6 @@ /* * -* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java index c0d6c4cdb84ee..2a8959e5d7fe9 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java index eda1eada737b3..622102a3a6775 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java index 64b0600674fd6..f8cb10cf29b3e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java index 894fca94a7738..9c64126c62d30 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/DirectHotSpotObjectConstantImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/DirectHotSpotObjectConstantImpl.java index 8385aaa6560e1..c241af0348aef 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/DirectHotSpotObjectConstantImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/DirectHotSpotObjectConstantImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java index ab7a57f2759d4..49dfdcea5a219 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java index 0becdf299765d..370eaee7b3fee 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstant.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstant.java index e0ae6b4c881f3..81b25e6c51d86 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstant.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java index f4f8736a2feda..6a9167e687bcf 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index d25a7c974a5cf..6bff3ce58cff5 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java index 358441d0b2282..55d5492c2f8da 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java index 3d3d140b1ca79..4685ff4d1b4b5 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java index e4a77daf0d448..cf3ac0f994a00 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java index 57cec3ef1942a..fd46e281c3bd0 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java index ab8b3d335cb18..d7e8fd37ab277 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotJVMCIBackendFactory.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotJVMCIBackendFactory.java index 9e7d7679cabba..6e0eac91d6100 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotJVMCIBackendFactory.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotJVMCIBackendFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotVMConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotVMConfig.java index 7f19efc456690..1d52556522e36 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotVMConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/riscv64/RISCV64HotSpotVMConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/MethodHandleAccessProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/MethodHandleAccessProvider.java index eb8b9721d49ce..f4aa7b28bed5d 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/MethodHandleAccessProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/MethodHandleAccessProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java index fa42dc26ac8da..8758dbb3bb620 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/riscv64/RISCV64.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/riscv64/RISCV64.java index 2da9d51cca25f..976c09cb75b85 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/riscv64/RISCV64.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/riscv64/RISCV64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java index 72c07b3ac989a..d417100224771 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java index 69db8f0800c77..8f5fec1e4b95a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java index 7efaec8769245..15f55d18cc0f0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java @@ -31,7 +31,6 @@ import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; -import javax.lang.model.element.TypeParameterElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.ExecutableType; @@ -43,7 +42,6 @@ import jdk.javadoc.internal.html.Content; import jdk.javadoc.internal.html.ContentBuilder; import jdk.javadoc.internal.html.Entity; -import jdk.javadoc.internal.html.HtmlTag; import jdk.javadoc.internal.html.HtmlTree; import jdk.javadoc.internal.html.Text; @@ -94,7 +92,6 @@ protected AbstractExecutableMemberWriter(SubWriterHolderWriter writer) { */ protected Content getTypeParameters(ExecutableElement member) { HtmlLinkInfo linkInfo = new HtmlLinkInfo(configuration, LINK_TYPE_PARAMS_AND_BOUNDS, member) - .addLineBreaksInTypeParameters(true) .showTypeParameterAnnotations(true); return writer.getTypeParameterLinks(linkInfo); } @@ -129,7 +126,15 @@ protected void addSummaryLink(HtmlLinkInfo.Kind context, TypeElement te, Element @Override protected void addInheritedSummaryLink(TypeElement te, Element member, Content target) { - target.add(writer.getDocLink(PLAIN, te, member, name(member))); + // Use method name as link label, but add signature as title attribute + String name = name(member); + ExecutableElement ee = (ExecutableElement) member; + String title = name + utils.makeSignature(ee, typeElement, false, true); + target.add(writer.getLink(new HtmlLinkInfo(configuration, PLAIN, te) + .label(name) + .fragment(htmlIds.forMember(ee).getFirst().name()) + .targetMember(member) + .title(title))); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java index 59a8f58923085..4f2e17aa876d6 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java @@ -52,8 +52,8 @@ import jdk.javadoc.internal.html.Content; import jdk.javadoc.internal.html.ContentBuilder; import jdk.javadoc.internal.html.Entity; -import jdk.javadoc.internal.html.HtmlTag; import jdk.javadoc.internal.html.HtmlTree; +import jdk.javadoc.internal.html.Text; import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.ANNOTATION_TYPE_MEMBER; import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL; @@ -717,4 +717,19 @@ protected Content getMemberListItem(Content memberContent) { return writer.getMemberListItem(memberContent); } + /** + * {@return a link to the member summary section of class or interface {@code element} indicated + * by {@code summaryKind} with the simple type name as link label, or the fully qualified type name + * if the class or interface is not linkable} + */ + protected Content getMemberSummaryLinkOrFQN(TypeElement element, VisibleMemberTable.Kind summaryKind) { + if (utils.isLinkable(element)) { + return writer.getLink((new HtmlLinkInfo(configuration, HtmlLinkInfo.Kind.PLAIN, element) + .label(utils.getSimpleName(element)) + .fragment(HtmlIds.forMemberSummary(summaryKind).name()))); + } else { + return Text.of(utils.getFullyQualifiedName(element)); + } + } + } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java index c466a2fcb5aa7..12e6fbab46977 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java index 915dbd7627a73..a6f3ac7dd2822 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java index 68ee6d98857e5..ea0ea1f79fe8e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java index 2c9539d3c30dc..b80be46aa24e5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriter.java index d934a9aab63b1..bef634b0ddb9f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriter.java @@ -740,16 +740,14 @@ private Content getClassLinks(HtmlLinkInfo.Kind context, Collection list) { } // TODO: should we simply split this method up to avoid instanceof ? if (type instanceof TypeElement te) { - Content link = getLink( - new HtmlLinkInfo(configuration, context, te)); - content.add(HtmlTree.CODE(link)); + content.add(getLink( + new HtmlLinkInfo(configuration, context, te))); } else { - Content link = getLink( - new HtmlLinkInfo(configuration, context, ((TypeMirror)type))); - content.add(HtmlTree.CODE(link)); + content.add(getLink( + new HtmlLinkInfo(configuration, context, ((TypeMirror)type)))); } } - return content; + return HtmlTree.CODE(content); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriter.java index 213078712ebf0..c71d62d57e48b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriter.java @@ -230,8 +230,7 @@ protected Table createSummaryTable() { @Override public void addInheritedSummaryLabel(TypeElement typeElement, Content content) { - Content classLink = writer.getPreQualifiedClassLink( - HtmlLinkInfo.Kind.PLAIN, typeElement); + Content classLink = getMemberSummaryLinkOrFQN(typeElement, VisibleMemberTable.Kind.FIELDS); Content label; if (options.summarizeOverriddenMethods()) { label = Text.of(utils.isClass(typeElement) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java index ca20d065a1e34..2794a13f9dad0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkFactory.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkFactory.java index 54da5af14a9d4..3dce7920db975 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkFactory.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkFactory.java @@ -236,20 +236,16 @@ public Content visitDeclared(DeclaredType type, HtmlLinkInfo linkInfo) { protected Content getClassLink(HtmlLinkInfo linkInfo) { BaseConfiguration configuration = m_writer.configuration; TypeElement typeElement = linkInfo.getTypeElement(); - // Create a tool tip if we are linking to a class or interface. Don't - // create one if we are linking to a member. - String title = ""; - String fragment = linkInfo.getFragment(); - boolean hasFragment = fragment != null && !fragment.isEmpty(); - if (!hasFragment) { - boolean isTypeLink = linkInfo.getType() != null && - utils.isTypeVariable(utils.getComponentType(linkInfo.getType())); - title = getClassToolTip(typeElement, isTypeLink); - if (isTypeLink) { - linkInfo.fragment(m_writer.configuration.htmlIds.forTypeParam( - utils.getTypeName(utils.getComponentType(linkInfo.getType()), false), - typeElement).name()); - } + // Create a tool tip if we are linking to a class or interface, or one of + // its summary sections. Don't create one if we are linking to a member. + boolean isPageOrSummaryLink = linkInfo.isPageOrSummaryLink(); + TypeMirror type = linkInfo.getType(); + if (type != null && utils.isTypeVariable(utils.getComponentType(type))) { + linkInfo.fragment(m_writer.configuration.htmlIds.forTypeParam( + utils.getTypeName(utils.getComponentType(type), false), typeElement).name()) + .title(getClassToolTip(typeElement, true)); + } else if (isPageOrSummaryLink) { + linkInfo.title(getClassToolTip(typeElement, false)); } Content label = linkInfo.getClassLinkLabel(configuration); if (linkInfo.getContext() == HtmlLinkInfo.Kind.SHOW_TYPE_PARAMS_IN_LABEL) { @@ -261,7 +257,7 @@ protected Content getClassLink(HtmlLinkInfo linkInfo) { Element previewTarget; ExecutableElement restrictedTarget; boolean showPreview = !linkInfo.isSkipPreview(); - if (!hasFragment && showPreview) { + if (isPageOrSummaryLink && showPreview) { flags = utils.elementFlags(typeElement); previewTarget = typeElement; restrictedTarget = null; @@ -301,7 +297,7 @@ protected Content getClassLink(HtmlLinkInfo linkInfo) { if (linkInfo.linkToSelf() || typeElement != m_writer.getCurrentPageElement()) { link.add(m_writer.links.createLink( fileName.fragment(linkInfo.getFragment()), - label, linkInfo.getStyle(), title)); + label, linkInfo.getStyle(), linkInfo.getTitle())); addSuperscript(link, flags, fileName, null, previewTarget, restrictedTarget); return link; } @@ -461,11 +457,12 @@ private HtmlLinkInfo getBoundsLinkInfo(HtmlLinkInfo linkInfo, TypeMirror bound) * Given a class, return the appropriate tool tip. * * @param typeElement the class to get the tool tip for. + * @param isTypeParamLink true if link target is a type parameter * @return the tool tip for the appropriate class. */ - private String getClassToolTip(TypeElement typeElement, boolean isTypeLink) { + private String getClassToolTip(TypeElement typeElement, boolean isTypeParamLink) { Resources resources = m_writer.configuration.getDocResources(); - if (isTypeLink) { + if (isTypeParamLink) { return resources.getText("doclet.Href_Type_Param_Title", utils.getSimpleName(typeElement)); } else if (utils.isPlainInterface(typeElement)){ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkInfo.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkInfo.java index 0b7be8fe6562a..9b5686731919d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkInfo.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkInfo.java @@ -31,7 +31,6 @@ import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeMirror; -import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyles; import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; import jdk.javadoc.internal.doclets.toolkit.util.Utils; import jdk.javadoc.internal.html.Content; @@ -110,6 +109,9 @@ public enum Kind { // The label for the link. private Content label; + // The title attribute for the link + private String title; + // True if we should print the type bounds for the type parameter. private boolean showTypeBounds = true; @@ -123,9 +125,6 @@ public enum Kind { // True iff the preview flags should be skipped for this link. private boolean skipPreview; - // True if type parameters should be separated by hard line breaks. - private boolean addLineBreaksInTypeParameters = false; - // True if additional tags should be added to type parameters private boolean addLineBreakOpportunitiesInTypeParameters = false; @@ -183,7 +182,6 @@ public HtmlLinkInfo forType(TypeMirror type) { linkInfo.showTypeBounds = showTypeBounds; linkInfo.linkTypeParameters = linkTypeParameters; linkInfo.linkToSelf = linkToSelf; - linkInfo.addLineBreaksInTypeParameters = addLineBreaksInTypeParameters; linkInfo.showTypeParameterAnnotations = showTypeParameterAnnotations; linkInfo.skipPreview = skipPreview; return linkInfo; @@ -264,6 +262,23 @@ public HtmlStyle getStyle() { return style; } + /** + * Sets the title attribute for the link. + * @param title the value of the title attribute + * @return this object + */ + public HtmlLinkInfo title(String title) { + this.title = title; + return this; + } + + /** + * {@return the value of the title attribute} + */ + public String getTitle() { + return title; + } + /** * Set whether or not this is a link to a varargs parameter. * @param varargs the new value @@ -299,20 +314,10 @@ public String getFragment() { } /** - * Sets the addLineBreaksInTypeParameters flag for this link. - * @param addLineBreaksInTypeParameters the new value - * @return this object - */ - public HtmlLinkInfo addLineBreaksInTypeParameters(boolean addLineBreaksInTypeParameters) { - this.addLineBreaksInTypeParameters = addLineBreaksInTypeParameters; - return this; - } - - /** - * {@return true if type parameters should be separated by line breaks} + * {@return {@code true} if the link target is the top level page or one of its summary sections} */ - public boolean addLineBreaksInTypeParameters() { - return addLineBreaksInTypeParameters; + public boolean isPageOrSummaryLink() { + return fragment == null || fragment.isEmpty() || fragment.endsWith("-summary"); } /** @@ -506,7 +511,6 @@ public String toString() { ", showTypeBounds=" + showTypeBounds + ", linkTypeParameters=" + linkTypeParameters + ", linkToSelf=" + linkToSelf + - ", addLineBreaksInTypeParameters=" + addLineBreaksInTypeParameters + ", showTypeParameterAnnotations=" + showTypeParameterAnnotations + ", context=" + context + ", fragment=" + fragment + diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java index a7afd9db85d09..2ad39dbf94cf3 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java index 78696cc320ea2..fac6ed76e48b4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriter.java index 9325bc07a6d99..1f3cfe2680190 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriter.java @@ -306,8 +306,7 @@ protected Table createSummaryTable() { @Override public void addInheritedSummaryLabel(TypeElement typeElement, Content content) { - Content classLink = writer.getPreQualifiedClassLink( - HtmlLinkInfo.Kind.PLAIN, typeElement); + Content classLink = getMemberSummaryLinkOrFQN(typeElement, VisibleMemberTable.Kind.METHODS); Content label; if (options.summarizeOverriddenMethods()) { label = Text.of(utils.isClass(typeElement) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java index 86e81b77ddd76..25f6a46b1efbd 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriter.java index 12d4dcbd6638d..8368172430e7c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * 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 @@ protected Table createSummaryTable() { @Override public void addInheritedSummaryLabel(TypeElement typeElement, Content content) { - Content classLink = writer.getPreQualifiedClassLink(HtmlLinkInfo.Kind.PLAIN, typeElement); + Content classLink = getMemberSummaryLinkOrFQN(typeElement, VisibleMemberTable.Kind.NESTED_CLASSES); Content label; if (options.summarizeOverriddenMethods()) { label = Text.of(utils.isPlainInterface(typeElement) @@ -135,7 +135,7 @@ protected void addSummaryLink(HtmlLinkInfo.Kind context, TypeElement typeElement @Override protected void addInheritedSummaryLink(TypeElement typeElement, Element member, Content target) { target.add( - writer.getLink(new HtmlLinkInfo(configuration, HtmlLinkInfo.Kind.LINK_TYPE_PARAMS_AND_BOUNDS, + writer.getLink(new HtmlLinkInfo(configuration, HtmlLinkInfo.Kind.SHOW_TYPE_PARAMS, (TypeElement)member))); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java index fd257fc06f48e..375bfd2760954 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriter.java index 7365b9b3b8f9a..294923f43a12e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriter.java @@ -259,8 +259,7 @@ protected Table createSummaryTable() { @Override public void addInheritedSummaryLabel(TypeElement typeElement, Content content) { - Content classLink = writer.getPreQualifiedClassLink( - HtmlLinkInfo.Kind.PLAIN, typeElement); + Content classLink = getMemberSummaryLinkOrFQN(typeElement, VisibleMemberTable.Kind.PROPERTIES); Content label; if (options.summarizeOverriddenMethods()) { label = Text.of(utils.isClass(typeElement) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/RestrictedListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/RestrictedListWriter.java index ec629a227a328..8f78027bed27e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/RestrictedListWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/RestrictedListWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialFieldWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialFieldWriter.java index ef9810f73749b..7de92d0821466 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialFieldWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialFieldWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialMethodWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialMethodWriter.java index 4ce7d662abbdb..62758bf3f07fb 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialMethodWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerialMethodWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriter.java index 09fa5ed347c42..118f6efd0d681 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java index aa20fc8c9aebc..68d2bc8b4d0d9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java index 0e09920b7b158..6ba40145e8fce 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Table.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TableHeader.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TableHeader.java index e1c42062c2190..52ca845d26e75 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TableHeader.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TableHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java index 8af3b7016cecb..124fbce3c7f65 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactory.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactory.java index d656fe35293a4..2b2a12321374e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactory.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java index 051cbfd00423b..a7181ac7f675b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/package-info.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/package-info.java index efad5fc0fe925..aa5873098f6d1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/package-info.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/BaseTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/BaseTaglet.java index 7b0a4329ee1c7..dd22274f31312 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/BaseTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/BaseTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DeprecatedTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DeprecatedTaglet.java index fa30589e59d3d..dc7a30d8643fd 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DeprecatedTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DeprecatedTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DocRootTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DocRootTaglet.java index d4050f6e0ec26..f2a62cb83c128 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DocRootTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/DocRootTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/IndexTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/IndexTaglet.java index 6f5077bb32c1f..1ce2384067ccf 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/IndexTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/IndexTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/LiteralTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/LiteralTaglet.java index c0543026f23dd..42f5fe3b8103e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/LiteralTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/LiteralTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ReturnTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ReturnTaglet.java index b9572afb9bc4f..38ab48bb61f05 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ReturnTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ReturnTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SummaryTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SummaryTaglet.java index 7912abef0c6ec..d1f2cbdcf64f4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SummaryTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SummaryTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java index 4cab9d90ce0d0..cac058aabdc74 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/Taglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/Taglet.java index c1c6a56e5cbb3..a5a565b4da92d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/Taglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/Taglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ThrowsTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ThrowsTaglet.java index ca4a8c939abba..5a92bf42a04bd 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ThrowsTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ThrowsTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/UserTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/UserTaglet.java index cc5ae21ba2965..d1884c53ccfc6 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/UserTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/UserTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ValueTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ValueTaglet.java index a4fddef0f117a..506bec8b51776 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ValueTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/ValueTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java index a4d5f4fae0ecb..a1533eb115ac4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java index 576bf64e751f7..9d77b390c3e1c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Messages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java index 81daa41c3571f..17f98cf05a814 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Comment.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Comment.java index 77b456cc7ffe8..4e57132b5f0b5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Comment.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Comment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/html/DocType.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/DocType.java index 5e6bf502fe111..5444d75c20a7d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/DocType.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/DocType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlId.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlId.java index a6af14382848b..54ad843d03f6f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlId.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlId.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Script.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Script.java index a5fc15215092c..642d74d54e7f5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Script.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/Script.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/package-info.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/package-info.java index dffb34f1e9306..160cd1f81b251 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/package-info.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java index 8390831b24964..b4ee61fc36c76 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java index 5eed7cd926894..8c8e06fb6164e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jcmd/share/man/jinfo.md b/src/jdk.jcmd/share/man/jinfo.md index 5e8603e0e0825..b70bc4c45eee0 100644 --- a/src/jdk.jcmd/share/man/jinfo.md +++ b/src/jdk.jcmd/share/man/jinfo.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jcmd/share/man/jmap.md b/src/jdk.jcmd/share/man/jmap.md index 1f986f97fab8b..b0352ad91941f 100644 --- a/src/jdk.jcmd/share/man/jmap.md +++ b/src/jdk.jcmd/share/man/jmap.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jcmd/share/man/jps.md b/src/jdk.jcmd/share/man/jps.md index be3994c411e93..2db93878801a3 100644 --- a/src/jdk.jcmd/share/man/jps.md +++ b/src/jdk.jcmd/share/man/jps.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jcmd/share/man/jstack.md b/src/jdk.jcmd/share/man/jstack.md index 84df235a70e4a..15849502d8cc4 100644 --- a/src/jdk.jcmd/share/man/jstack.md +++ b/src/jdk.jcmd/share/man/jstack.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jcmd/share/man/jstat.md b/src/jdk.jcmd/share/man/jstat.md index 795fc9caa405f..324d0a48cb24d 100644 --- a/src/jdk.jcmd/share/man/jstat.md +++ b/src/jdk.jcmd/share/man/jstat.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jconsole/share/classes/sun/tools/jconsole/resources/messages_de.properties b/src/jdk.jconsole/share/classes/sun/tools/jconsole/resources/messages_de.properties index e6859fd8d74a6..947fb1c8d66fa 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/resources/messages_de.properties +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/resources/messages_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jconsole/share/man/jconsole.md b/src/jdk.jconsole/share/man/jconsole.md index 59c84a0431a45..6412937830bc3 100644 --- a/src/jdk.jconsole/share/man/jconsole.md +++ b/src/jdk.jconsole/share/man/jconsole.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java index b3c6b5b6c640d..c267d9748fde6 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java index 138a76b6f2ecf..0d02d664de2a3 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java index f19d8fce4bbb5..7fcd213cd0bc4 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java index 04e7b3fd0e0b8..c472ea48b6f2c 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/Options.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/Options.java index e93dd2daf85ae..503989f4900e3 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/Options.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/Options.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/SourceWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/SourceWriter.java index 884c0fa9f80bc..94c10f5a5f9cf 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/SourceWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/SourceWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java index d899569724e66..5b7de2a4565ca 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/StackMapWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java index d5e19bc4241c2..a1ad88541616a 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties index 02e277e2235dd..29bff0ffe54c0 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_de.properties b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_de.properties index 1c98b4cac6a9d..3575f134dfc8c 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_de.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties index 4cc9e83070d91..a759117f727fa 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties index 77c2fdd6b6366..bc6137f7f13e3 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties index 35f59cac9261a..000425923c460 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdkinternals.properties @@ -1,6 +1,6 @@ ########################################################################### # -# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/man/javap.md b/src/jdk.jdeps/share/man/javap.md index 814db56b3bad4..d09ac57f1966e 100644 --- a/src/jdk.jdeps/share/man/javap.md +++ b/src/jdk.jdeps/share/man/javap.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/man/jdeprscan.md b/src/jdk.jdeps/share/man/jdeprscan.md index 8f76b29aee345..788d82e09db5d 100644 --- a/src/jdk.jdeps/share/man/jdeprscan.md +++ b/src/jdk.jdeps/share/man/jdeprscan.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdeps/share/man/jdeps.md b/src/jdk.jdeps/share/man/jdeps.md index cb936bf3e0128..52c2d4bffe43b 100644 --- a/src/jdk.jdeps/share/man/jdeps.md +++ b/src/jdk.jdeps/share/man/jdeps.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java b/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java index fd1b97161c727..bccdf4cc8bf57 100644 --- a/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java +++ b/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_de.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_de.java index 04ec27a624d5e..f3aadd3677ca0 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_de.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_de.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java b/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java index 41a1972a937d1..8ab3d97ea581a 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jdi/share/man/jdb.md b/src/jdk.jdi/share/man/jdb.md index e163cbf5e230a..75d2d9a150c12 100644 --- a/src/jdk.jdi/share/man/jdb.md +++ b/src/jdk.jdi/share/man/jdb.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jdi/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java b/src/jdk.jdi/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java index ae3ccf7f14921..fdbc4c8807f6d 100644 --- a/src/jdk.jdi/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java +++ b/src/jdk.jdi/windows/classes/com/sun/tools/jdi/SharedMemoryTransportService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java index 1373c3ca4968f..ed9e1e4362528 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/EventWriterKey.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriterKey.java index 7f9c22f02341d..8301de748da64 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriterKey.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriterKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java index 3f0611f998173..2cf56c67cb558 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java index 8d51cb1de6f17..ff4898bc926f8 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/periodic/BatchManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java index 781661a427f2e..4d947eea9a5f5 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedMethods.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedMethods.java index 7e425b3bdb5a9..646150629f8e0 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedMethods.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedThing.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedThing.java index 6d607557caf30..42445d79e78b1 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedThing.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedThing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/internal/util/Bytecode.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/util/Bytecode.java index c51c3afe331ce..1241993e762bc 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/util/Bytecode.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/util/Bytecode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/classes/jdk/jfr/snippet-files/Snippets.java b/src/jdk.jfr/share/classes/jdk/jfr/snippet-files/Snippets.java index 37487d7195aa5..b2f3f62fbe7d6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/snippet-files/Snippets.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/snippet-files/Snippets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jfr/share/man/jfr.md b/src/jdk.jfr/share/man/jfr.md index 185d7cfc3b32e..b516c590084ef 100644 --- a/src/jdk.jfr/share/man/jfr.md +++ b/src/jdk.jfr/share/man/jfr.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java index bbf2bfacd007c..fff585bb2dd31 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java index f9a5463609a9f..86f68098453e6 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_de.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_de.properties index 833b56ee5f381..31ed02a693ceb 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_de.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties index e54e62bafed9e..2beac29ca5434 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties index 9c44e826b9358..9bd20e1d843f2 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jlink/share/man/jlink.md b/src/jdk.jlink/share/man/jlink.md index 8c344a692cbed..74f2d119c6980 100644 --- a/src/jdk.jlink/share/man/jlink.md +++ b/src/jdk.jlink/share/man/jlink.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jlink/share/man/jmod.md b/src/jdk.jlink/share/man/jmod.md index 273001b6a9a88..6fd2aa54cf917 100644 --- a/src/jdk.jlink/share/man/jmod.md +++ b/src/jdk.jlink/share/man/jmod.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxLaunchersAsServices.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxLaunchersAsServices.java index 1f86ce6fd236d..433ea0fbe042e 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxLaunchersAsServices.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxLaunchersAsServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/share/classes/jdk/jpackage/internal/Enquoter.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Enquoter.java index 5f016c3f4bf19..51f97ad2cd618 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Enquoter.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Enquoter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/share/classes/jdk/jpackage/internal/PackageFile.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackageFile.java index e8bc0cb665538..bec8fb86befca 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackageFile.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackageFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/share/native/common/ErrorHandling.cpp b/src/jdk.jpackage/share/native/common/ErrorHandling.cpp index a3a4c2a9dfe12..6d4daaaba055e 100644 --- a/src/jdk.jpackage/share/native/common/ErrorHandling.cpp +++ b/src/jdk.jpackage/share/native/common/ErrorHandling.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/share/native/common/Log.cpp b/src/jdk.jpackage/share/native/common/Log.cpp index 8227bb1cce4dd..ecdeeb325a7be 100644 --- a/src/jdk.jpackage/share/native/common/Log.cpp +++ b/src/jdk.jpackage/share/native/common/Log.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/unix/classes/jdk/jpackage/internal/ShellScriptResource.java b/src/jdk.jpackage/unix/classes/jdk/jpackage/internal/ShellScriptResource.java index c6303636c66f4..268c6d173aa0b 100644 --- a/src/jdk.jpackage/unix/classes/jdk/jpackage/internal/ShellScriptResource.java +++ b/src/jdk.jpackage/unix/classes/jdk/jpackage/internal/ShellScriptResource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/unix/classes/jdk/jpackage/internal/UnixLaunchersAsServices.java b/src/jdk.jpackage/unix/classes/jdk/jpackage/internal/UnixLaunchersAsServices.java index 3d8982584e1b1..cbe772a3ae47a 100644 --- a/src/jdk.jpackage/unix/classes/jdk/jpackage/internal/UnixLaunchersAsServices.java +++ b/src/jdk.jpackage/unix/classes/jdk/jpackage/internal/UnixLaunchersAsServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java index 7c4b6092901b4..7eb7b922667f6 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jpackage/windows/native/libjpackage/jpackage.cpp b/src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp index 66fa92e35637b..3e922bceb2cdd 100644 --- a/src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp +++ b/src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java index 7a1234628deea..aa1f840c9c392 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/IOContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_de.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_de.properties index 21f308910081e..a275ab8a080f6 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_de.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties index 87533d2837103..ab62e05ca8b6c 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties index d9fe0e492ea0e..ebab8f9f08fff 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/JavadocFormatter.java b/src/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/JavadocFormatter.java index 07d3ccae5105c..932241b2d6183 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/JavadocFormatter.java +++ b/src/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/JavadocFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/resources/javadocformatter.properties b/src/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/resources/javadocformatter.properties index 6d8cc024e54cf..f5f0eca2bacef 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/resources/javadocformatter.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/shellsupport/doc/resources/javadocformatter.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java index e2a5446393bcc..e387af1a2cf01 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java b/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java index df21f17898931..2af344ef57bd7 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java b/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java index 064bcbaf55629..d5bfa386909b9 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/ExpressionToTypeInfo.java b/src/jdk.jshell/share/classes/jdk/jshell/ExpressionToTypeInfo.java index 8bc339c6dab8e..2903e5656d6d3 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/ExpressionToTypeInfo.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/ExpressionToTypeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java b/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java index 188b34ab183e8..e3e80d3836f06 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/JShellConsole.java b/src/jdk.jshell/share/classes/jdk/jshell/JShellConsole.java index 014766f9ff7c4..09e0c25b97400 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/JShellConsole.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/JShellConsole.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/KeyMap.java b/src/jdk.jshell/share/classes/jdk/jshell/KeyMap.java index e350cf4a7d794..ae8441f9abb0a 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/KeyMap.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/KeyMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/MaskCommentsAndModifiers.java b/src/jdk.jshell/share/classes/jdk/jshell/MaskCommentsAndModifiers.java index 5a6c1688dc08d..becdb60129aa1 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/MaskCommentsAndModifiers.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/MaskCommentsAndModifiers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java b/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java index 3642ed3fc06c5..9691eaaa9c3da 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/SnippetMaps.java b/src/jdk.jshell/share/classes/jdk/jshell/SnippetMaps.java index 0bbf2a5dceb99..da3170e39483a 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/SnippetMaps.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/SnippetMaps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java b/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java index 5360e0d517fc7..c0e01f128b7f1 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/TreeDissector.java b/src/jdk.jshell/share/classes/jdk/jshell/TreeDissector.java index fc259b8bc7ca2..ef50f8ce71cfc 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/TreeDissector.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/TreeDissector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java b/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java index fb6378b24f93f..0889fad6c71b5 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/TypePrinter.java b/src/jdk.jshell/share/classes/jdk/jshell/TypePrinter.java index 76f2e929e34c3..9e758bb114529 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/TypePrinter.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/TypePrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/Wrap.java b/src/jdk.jshell/share/classes/jdk/jshell/Wrap.java index 57ed543ce25ec..990dbd8bece70 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/Wrap.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/Wrap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java b/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java index 54c4131ee3bca..5f9b7f0ba3de1 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java b/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java index 889b8494bab91..a9136e7e87603 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java b/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java index 3076c0fa76dce..1f4dae2df3819 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.jshell/share/man/jshell.md b/src/jdk.jshell/share/man/jshell.md index b9f9fe577cfa4..62237f1447f72 100644 --- a/src/jdk.jshell/share/man/jshell.md +++ b/src/jdk.jshell/share/man/jshell.md @@ -1,5 +1,5 @@ --- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent.properties index 5ee066fe825f9..323c4a1e1a4e0 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_de.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_de.properties index ec8882be5da7b..0641e98a135a6 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_de.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_es.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_es.properties index 9d408730cd080..ad2665e2ff44e 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_es.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_es.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_fr.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_fr.properties index 011ae2fce6c92..28e2182522063 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_fr.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_fr.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_it.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_it.properties index 91cf39bdb3f14..005dec54ea8a6 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_it.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_it.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ja.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ja.properties index 0f19b3060d2cb..ecaf1024d60ad 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ja.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ko.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ko.properties index 9fabc5c0b362d..f4ff84db84e32 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ko.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_ko.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_pt_BR.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_pt_BR.properties index 5343c8e16e743..773042234e946 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_pt_BR.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_pt_BR.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_sv.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_sv.properties index a3c695df0eb03..7c4f2559ce181 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_sv.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_sv.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_CN.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_CN.properties index 5d33a024cce3d..64fdd2634e3fc 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_CN.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_TW.properties b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_TW.properties index 51cf018682570..55e9da252f20f 100644 --- a/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_TW.properties +++ b/src/jdk.management.agent/share/classes/jdk/internal/agent/resources/agent_zh_TW.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. # 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/jdk.management.jfr/share/classes/jdk/management/jfr/FileDump.java b/src/jdk.management.jfr/share/classes/jdk/management/jfr/FileDump.java index 37ba296732635..75bf37e0b265e 100644 --- a/src/jdk.management.jfr/share/classes/jdk/management/jfr/FileDump.java +++ b/src/jdk.management.jfr/share/classes/jdk/management/jfr/FileDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java b/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java index d20d1ead35fc7..04b25081642c5 100644 --- a/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java +++ b/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java b/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java index ebbda8db70c5a..1fcbb2ba6a65b 100644 --- a/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java +++ b/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java @@ -37,7 +37,6 @@ import java.util.HashMap; import sun.management.LazyCompositeData; import static sun.management.LazyCompositeData.getString; -import sun.management.Util; /** * A CompositeData for GarbageCollectionNotificationInfo for the local management support. diff --git a/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java b/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java index 0ceb1f6b6d2db..e607277467b9d 100644 --- a/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java +++ b/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * 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 javax.management.openmbean.CompositeType; import javax.management.openmbean.OpenDataException; import com.sun.management.GcInfo; -import sun.management.Util; /** * Helper class to build composite data. diff --git a/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java b/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java index 6b3d2cc7bb993..9ccbe5133059a 100644 --- a/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java +++ b/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java @@ -41,7 +41,6 @@ import sun.management.LazyCompositeData; import static sun.management.LazyCompositeData.getLong; import sun.management.MappedMXBeanType; -import sun.management.Util; /** * A CompositeData for GcInfo for the local management support. diff --git a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java index fe35a4979cc3b..cb0f15fbd6b0f 100644 --- a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java +++ b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.naming.rmi/share/classes/module-info.java b/src/jdk.naming.rmi/share/classes/module-info.java index f2ba8f7775f80..4b91cd2bec996 100644 --- a/src/jdk.naming.rmi/share/classes/module-info.java +++ b/src/jdk.naming.rmi/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * 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/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java b/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java index b7010b2e740a4..404299ef7527f 100644 --- a/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java +++ b/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * 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/utils/IdealGraphVisualizer/Bytecodes/pom.xml b/src/utils/IdealGraphVisualizer/Bytecodes/pom.xml index 1ac64b16a4ae9..78e1b3285013c 100644 --- a/src/utils/IdealGraphVisualizer/Bytecodes/pom.xml +++ b/src/utils/IdealGraphVisualizer/Bytecodes/pom.xml @@ -1,6 +1,6 @@