Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
78580f1
8378291: Test vector in test/jdk/java/util/jar/JarEntry/GetMethodsRet…
jaikiran Apr 9, 2026
61b2508
8320897: compiler/vectorapi/reshape/TestVectorReinterpret.java fails …
TheRealMDoerr Apr 9, 2026
60115c0
8380158: C2: compiler/c2/TestGVNCrash.java asserts with adr and adr_t…
rwestrel Apr 9, 2026
261011a
8372325: Refactor tests under jdk/java/net/httpclient to use ${test.m…
PeyaPeyaPeyang Apr 9, 2026
289f3e2
8381184: Code clean up: missing line break and print out duplication
Apr 9, 2026
31b5887
8381566: G1: Concurrent refinement pre-sweep time logged as incorrect…
Apr 9, 2026
81cc497
8381819: Test compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.…
Apr 9, 2026
9df6054
8380450: (zipfs) ZipFileSystem::getPath and ZipPath::resolve throw un…
Apr 9, 2026
d471f47
8381807: AArch64: compiler/cpuflags/CPUFeaturesClearTest.java fails o…
Apr 9, 2026
9a1f7d4
8326205: Grouping frequently called C2 nmethods in CodeCache
Apr 9, 2026
d68065e
8365498: jdk/jfr/event/os/TestCPULoad.java fails with Expected at lea…
egahlin Apr 9, 2026
e6bce14
8381765: AArch32: Capstone hsdis does not build
Apr 9, 2026
20387ff
8381879: JDK-8372617 has broken the Zero build
adinn Apr 9, 2026
df09910
8380947: Add pull request template
erikj79 Apr 9, 2026
24f7945
8377946: Use DWARF in mixed jstack on Linux AArch64
YaSuenag Apr 9, 2026
d89bd4c
8380542: ZipOutputStream.setComment and ZipEntry.setComment spec upda…
Apr 10, 2026
a0af250
8381006: G1: Wrong IHOP old gen allocation rate calculation in presen…
walulyai Apr 10, 2026
8357de8
8334868: Ensure CheckUninstallModalHook is called in WPageDialogPeer.…
aivanov-jdk Apr 10, 2026
d9c5c86
8374943: TestDirectBufferStatisticsEvent failed with too few statisti…
Apr 10, 2026
ccbbef5
8381654: Tokenizer warnings dropped when annotation processing is pre…
dbalek Apr 10, 2026
701d0cb
8381969: os::physical_memory is still broken in 32-bit systems when r…
Apr 10, 2026
a3309eb
8381899: Assertions and crashes in aot/cds tests on Linux Alpine
Apr 10, 2026
d3d8a0d
8381636: Add built-in AOT support to GrowableArray
iklam Apr 10, 2026
f7c0695
8381998: Move UseCompressedClassPointers to obsolete flags section
albertnetymk Apr 10, 2026
2b716d7
8381658: Update nsk/jvmti/scenarios/sampling to better test virtual t…
lmesnik Apr 10, 2026
aa5677a
8374496: C2: assert(val->find_edge(con) > 0) failed
Apr 10, 2026
322f3a3
8381932: Publish stubgen entries when -XX:-AOTStubCaching configured
adinn Apr 10, 2026
88bd42d
8314599: [GenShen] Couple adaptive tenuring and generation size budge…
Apr 10, 2026
aa6db8d
8382022: jpackage: enhance CompositeProxy
Apr 10, 2026
e893f4c
8196182: ServiceLoader.iterator().hasNext()/.next() may throw a Linka…
Apr 11, 2026
e7da737
8370648: TestOldGrowthTriggers.java fails 'Trigger (Old): Old has ove…
Apr 11, 2026
1e2b0d2
8382018: test/jdk/java/nio/file/spi/SetDefaultProvider.java leaves a …
ArnoZeller Apr 11, 2026
fb24606
8381623: Additional immutability in sun.font: ExtendedTextSourceLabel…
Apr 12, 2026
d75bb86
8380896: Reduce runtime for MonitorVmStartTerminate.java on hosts wit…
ArnoZeller Apr 13, 2026
6371da9
8378228: Replace jQuery UI autocomplete component in JavaDoc search
hns Apr 13, 2026
0acc1d1
8377163: C2: Iteration split must take into consideration sunk stores
merykitty Apr 13, 2026
78a6aa9
8381937: Make exceptions in Java_sun_security_mscapi_CKeyPairGenerato…
MBaesken Apr 13, 2026
909d4e7
8378838: Fix issues with "dead" code elimination and serviceability a…
MBaesken Apr 13, 2026
efe7fd8
8380163: Fix implicit conversion in macroAssembler_aarch64.hpp
lkorinth Apr 13, 2026
e8c77d1
8381900: Test vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001…
jsikstro Apr 13, 2026
fa61282
8381926: Fix implicit conversion in macroAssembler_riscv.hpp
DingliZhang Apr 13, 2026
d605b57
8179187: Misleading compilation error on annotated fully-qualified cl…
dbalek Apr 13, 2026
a76e38c
8381359: Refactor java/net/DatagramSocket TestNG tests to use JUnit
dfuch Apr 13, 2026
ac74e6f
8382055: G1: Remove unused unused args in mark_evac_failure_object
albertnetymk Apr 13, 2026
03b46a3
8381767: Refactor various java/net/*[URL/Http]*/ TestNG tests to use …
dfuch Apr 13, 2026
dd76306
8382048: JFR: RecordingFile::write doesn't truncate when overwriting
egahlin Apr 13, 2026
8882e7b
8382034: JFR: jdk-agents view is missing information
egahlin Apr 13, 2026
5cbc565
8382081: AOT tests fail in add_stub_entries without JVMCI
adinn Apr 13, 2026
121165e
8290892: C2: Intrinsify Reference.reachabilityFence
Apr 13, 2026
531dad0
8369917: LMS/HSS RFC 9858 Support
Apr 13, 2026
9d6a94e
8368091: Use JUnit Jupiter API in sun/net/ext, sun/net/www and sun/ne…
Apr 13, 2026
51cd741
8381670: Revert the changes to GZIPInputStream related to InputStream…
jaikiran Apr 14, 2026
da0ba89
8381768: C2: GC barrier stubs miscalculate skipped instructions size
shipilev Apr 14, 2026
f2f8828
8364182: Add jcmd VM.security_properties command
Apr 14, 2026
e71fa9e
8382057: C2: "assert((ptr->bottom_type() == Type::TOP) || ((base == C…
chhagedorn Apr 14, 2026
6548fb8
8382050: compiler/intrinsics/klass/CastNullCheckDroppingsTest.java fa…
chhagedorn Apr 14, 2026
c419983
8381934: Wrong type passed to FREE_C_HEAP_ARRAY deallocating G1CardSe…
Apr 14, 2026
64bbbe7
8380636: Add static asserts for mirrored library constants
jerboaa Apr 14, 2026
d5d8532
8381579: C2: "fatal error: LROTATE: double" when using VectorAPI
Apr 14, 2026
540c714
8382084: Use dynamic chunk sizes in PartialArraySplitter
walulyai Apr 14, 2026
d4bb97c
8379677: G1: Micros-System.gc benchmarks regress after moving to Part…
walulyai Apr 14, 2026
49a15be
8382020: Time Zone Abbreviation Not Localized for Non-English Locales
naotoj Apr 14, 2026
44c484c
8381677: Remove dependence of UseSHA on UseSHAIntrinsics
Apr 14, 2026
bf68776
8382167: Warning message should be displayed only when UseAESCTRIntri…
Apr 14, 2026
764fc09
8381643: Shenandoah: Remove duplicate region filtering logic
Apr 14, 2026
d57bbc0
8382087: aarch64: remove unused function declarations in macroAssembl…
RealFYang Apr 15, 2026
9ebee75
8379981: Virtual thread: crash in stackChunkOopDesc::print_on when th…
lingjun-cg Apr 15, 2026
20e8ea0
8382047: Update Libpng to 1.6.57
jayathirthrao Apr 15, 2026
2930e2b
8372797: [VectorAPI] Missing Min/Max identity transforms
Apr 15, 2026
0a6775a
8381787: Add testcase for Vector Lane Reversal issue
offamitkumar Apr 15, 2026
29024c2
8382202: New file VectorMinMaxTransforms.java has a copyright format …
Apr 15, 2026
436d291
8370863: VectorAPI: Optimize the VectorMaskCast chain in specific pat…
Apr 15, 2026
23a08ee
8382039: Add support do_arch_array_entry() template
adinn Apr 15, 2026
d114e8d
8375649: idea.sh script adds source paths in a single, enormous, line…
Apr 15, 2026
aece6f4
8381842: Refactor remaining TestNG tests under java/net/ to use JUnit
dfuch Apr 15, 2026
3384c67
8366444: Add support for add/mul reduction operations for Float16
Apr 15, 2026
0df4bd4
8381208: Init cause with the caught runtime exception
aivanov-jdk Apr 15, 2026
152fa85
8382134: Replace assert with fatal check in AOTCodeCache::load_string…
Apr 15, 2026
e82f871
8362350: recompute_enable hit assertion "should never come here befo…
lmesnik Apr 15, 2026
a06f3cd
8373248: C2: CastPP should not change the type of the oop
merykitty Apr 15, 2026
9745967
8381968: Extend cds/appcds/aotCode/AOTCodeFlags.java to run test with…
Apr 15, 2026
2121302
8380164: Fix implicit conversion in nativeInst_aarch64.hpp
lkorinth Apr 15, 2026
29434cc
8376421: C2: Missing branch on SubTypeCheck node
Apr 15, 2026
5acbf8b
8381871: GenShen: ShenandoahGCHeuristics flag not reset after ignorin…
pf0n Apr 15, 2026
2a8e3b8
8382174: Clarify the meaning of address cast in ADD() macro
Apr 15, 2026
a2e840f
8342786: Shenandoah: Emit AllocationRequiringGC jfr events
Apr 15, 2026
f87bb76
8381385: nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses00…
plummercj Apr 15, 2026
f2289d8
8381609: com/sun/jdi/EATests.java should not synchronize on an Intege…
plummercj Apr 15, 2026
533a8a8
8376839: GenShen: Improve performance of evacuations into the old gen…
Apr 15, 2026
a2261a4
8382196: Clean up C++ iterator style in compactHashtable.hpp and trai…
iklam Apr 16, 2026
940ac12
Merge branch 'sapmachine' into pr-jdk-27+18
RealCLanger Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions bin/idea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,18 @@ fi
SOURCE_PREFIX="<sourceFolder url=\"file://"
SOURCE_POSTFIX="\" isTestSource=\"false\" />"

# SOURCES is a single string containing embeded newlines.
for root in $MODULE_ROOTS; do
if [ "x$CYGPATH" != "x" ]; then
root=`$CYGPATH -am $root`
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
root=`wslpath -am $root`
fi

SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
# Add line termination/indentation for everything after the first entry.
if [ "x$SOURCES" != "x" ]; then
SOURCES="${SOURCES}\n "
fi
SOURCES="${SOURCES}${SOURCE_PREFIX}${root}${SOURCE_POSTFIX}"
done

add_replacement "###SOURCE_ROOTS###" "$SOURCES"
Expand Down
3 changes: 3 additions & 0 deletions make/Hsdis.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ ifeq ($(HSDIS_BACKEND), capstone)
else ifeq ($(call isTargetCpuArch, aarch64), true)
CAPSTONE_ARCH := CS_ARCH_$(CAPSTONE_ARCH_AARCH64_NAME)
CAPSTONE_MODE := CS_MODE_ARM
else ifeq ($(call isTargetCpuArch, arm), true)
CAPSTONE_ARCH := CS_ARCH_ARM
CAPSTONE_MODE := CS_MODE_ARM
else
$(error No support for Capstone on this platform)
endif
Expand Down
5 changes: 1 addition & 4 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
# reduce lib size on linux in link step, this needs also special compile flags
# do this on s390x also for libjvm (where serviceability agent is not supported)
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -ffunction-sections -fdata-sections"
if test "x$OPENJDK_TARGET_CPU" = xs390x && test "x$DEBUG_LEVEL" == xrelease; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
fi
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
fi
# technically NOT for CXX (but since this gives *worse* performance, use
# no-strict-aliasing everywhere!)
Expand Down
13 changes: 6 additions & 7 deletions make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -53,16 +53,15 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# add --icf=all (Identical Code Folding — merges identical functions)
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -Wl,--exclude-libs,ALL"

BASIC_LDFLAGS_JVM_ONLY=""
# Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections"
else
BASIC_LDFLAGS_JDK_ONLY="$BASIC_LDFLAGS_JDK_ONLY -Wl,--gc-sections"
fi
# keep vtables : -Wl,--undefined-glob=_ZTV* (but this seems not to work with gold ld)
# so keep at least the Metadata vtable that is used in the serviceability agent
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,--gc-sections -Wl,--undefined=_ZTV8Metadata"
BASIC_LDFLAGS_JDK_ONLY="$BASIC_LDFLAGS_JDK_ONLY -Wl,--gc-sections"
fi

BASIC_LDFLAGS_JVM_ONLY=""
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing $DEBUG_PREFIX_CFLAGS"

LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
Expand Down
38 changes: 26 additions & 12 deletions make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -801,10 +801,7 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
String tzKey = Optional.ofNullable((String)handlerSupplMeta.get(tzid))
.orElse(tzid);
// Follow link, if needed
String tzLink = null;
for (var k = tzKey; tzdbLinks.containsKey(k);) {
k = tzLink = tzdbLinks.get(k);
}
String tzLink = getTZDBLink(tzKey);
if (tzLink == null && tzdbLinks.containsValue(tzKey)) {
// reverse link search
// this is needed as in tzdb, "America/Buenos_Aires" links to
Expand Down Expand Up @@ -833,7 +830,7 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
} else {
// TZDB short names
tznames = Arrays.copyOf(tznames, tznames.length);
fillTZDBShortNames(tzid, tznames);
fillTZDBShortNames(tzKey, tznames);
names.put(tzid, tznames);
}
} else {
Expand All @@ -846,11 +843,13 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
String metaKey = METAZONE_ID_PREFIX + meta;
data = map.get(metaKey);
if (data instanceof String[] tznames) {
// TZDB short names
tznames = Arrays.copyOf((String[])names.getOrDefault(metaKey, tznames), 6);
fillTZDBShortNames(tzid, tznames);
// Keep the metazone prefix here.
names.putIfAbsent(metaKey, tznames);
if (isDefaultZone(meta, tzKey)) {
// Record the metazone names only from the default
// (001) zone, with short names filled from TZDB
tznames = Arrays.copyOf(tznames, tznames.length);
fillTZDBShortNames(tzKey, tznames);
names.put(metaKey, tznames);
}
names.put(tzid, meta);
if (tzLink != null && availableIds.contains(tzLink)) {
names.put(tzLink, meta);
Expand Down Expand Up @@ -1504,12 +1503,12 @@ private static String flipIfNeeded(boolean inVanguard, String format) {
* Fill the TZDB short names if there is no name provided by the CLDR
*/
private static void fillTZDBShortNames(String tzid, String[] names) {
var val = tzdbShortNamesMap.get(tzdbLinks.getOrDefault(tzid, tzid));
var val = tzdbShortNamesMap.getOrDefault(tzid, tzdbShortNamesMap.get(getTZDBLink(tzid)));
if (val != null) {
var format = val.split(NBSP)[0];
var rule = val.split(NBSP)[1];
IntStream.of(1, 3, 5).forEach(i -> {
if (names[i] == null) {
if (names[i] == null || names[i].isEmpty()) {
if (format.contains("%s")) {
names[i] = switch (i) {
case 1 -> format.formatted(tzdbSubstLetters.get(rule + NBSP + STD));
Expand All @@ -1531,6 +1530,21 @@ private static void fillTZDBShortNames(String tzid, String[] names) {
}
}

private static boolean isDefaultZone(String meta, String tzid) {
String zone001 = handlerMetaZones.zidMap().get(meta);
var tzLink = getTZDBLink(tzid);
return canonicalTZMap.getOrDefault(tzid, tzid).equals(zone001) ||
tzLink != null && canonicalTZMap.getOrDefault(tzLink, tzLink).equals(zone001);
}

private static String getTZDBLink(String tzid) {
String tzLink = null;
for (var k = tzid; tzdbLinks.containsKey(k);) {
k = tzLink = tzdbLinks.get(k);
}
return tzLink;
}

/*
* Convert TZDB offsets to JDK's offsets, eg, "-08" to "GMT-08:00".
* If it cannot recognize the pattern, return the argument as is.
Expand Down
9 changes: 8 additions & 1 deletion make/modules/jdk.hotspot.agent/Lib.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -55,6 +55,12 @@ else
LIBSAPROC_LINK_TYPE := C
endif

# DWARF related sources would be included on supported platforms only.
LIBSAPROC_EXCLUDE_FILES :=
ifneq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, x86_64 aarch64)), true)
LIBSAPROC_EXCLUDE_FILES := DwarfParser.cpp dwarf.cpp
endif

$(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
NAME := saproc, \
LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \
Expand All @@ -70,6 +76,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
CFLAGS := $(LIBSAPROC_CFLAGS), \
CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \
EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \
EXCLUDE_FILES := $(LIBSAPROC_EXCLUDE_FILES), \
JDK_LIBS := java.base:libjava, \
LIBS_linux := $(LIBDL), \
LIBS_macosx := \
Expand Down
98 changes: 84 additions & 14 deletions src/hotspot/cpu/aarch64/aarch64_vector.ad
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2020, 2025, Arm Limited. All rights reserved.
// Copyright (c) 2020, 2026, Arm Limited. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -247,10 +247,39 @@ source %{
case Op_MinVHF:
case Op_MaxVHF:
case Op_SqrtVHF:
if (UseSVE == 0 && !is_feat_fp16_supported()) {
return false;
}
break;
// At the time of writing this, the Vector API has no half-float (FP16) species.
// Consequently, AddReductionVHF and MulReductionVHF are only produced by the
// auto-vectorizer, which requires strictly ordered semantics for FP reductions.
//
// There is no direct Neon instruction that performs strictly ordered floating
// point add reduction. Hence, on Neon only machines, the add reduction operation
// is implemented as a scalarized sequence using half-precision scalar instruction
// FADD which requires FEAT_FP16 and ASIMDHP to be available on the target.
// On SVE machines (UseSVE > 0) however, there is a direct instruction (FADDA) which
// implements strictly ordered floating point add reduction which does not require
// the FEAT_FP16 and ASIMDHP checks as SVE supports half-precision floats by default.
case Op_AddReductionVHF:
// FEAT_FP16 is enabled if both "fphp" and "asimdhp" features are supported.
// Only the Neon instructions need this check. SVE supports half-precision floats
// by default.
if (UseSVE == 0 && !is_feat_fp16_supported()) {
if (length_in_bytes < 8 || (UseSVE == 0 && !is_feat_fp16_supported())) {
return false;
}
break;
case Op_MulReductionVHF:
// There are no direct Neon/SVE instructions that perform strictly ordered
// floating point multiply reduction.
// For vector length ≤ 16 bytes, the reduction is implemented as a scalarized
// sequence using half-precision scalar instruction FMUL. This path requires
// FEAT_FP16 and ASIMDHP to be available on the target.
// For vector length > 16 bytes, this operation is disabled because there is no
// direct SVE instruction that performs a strictly ordered FP16 multiply
// reduction.
if (length_in_bytes < 8 || length_in_bytes > 16 || !is_feat_fp16_supported()) {
return false;
}
break;
Expand Down Expand Up @@ -300,6 +329,7 @@ source %{
case Op_VectorRearrange:
case Op_MulReductionVD:
case Op_MulReductionVF:
case Op_MulReductionVHF:
case Op_MulReductionVI:
case Op_MulReductionVL:
case Op_CompressBitsV:
Expand Down Expand Up @@ -364,6 +394,7 @@ source %{
case Op_VectorMaskCmp:
case Op_LoadVectorGather:
case Op_StoreVectorScatter:
case Op_AddReductionVHF:
case Op_AddReductionVF:
case Op_AddReductionVD:
case Op_AndReductionV:
Expand Down Expand Up @@ -597,13 +628,9 @@ instruct vloadcon(vReg dst, immI0 src) %{
BasicType bt = Matcher::vector_element_basic_type(this);
if (UseSVE == 0) {
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
int entry_idx = __ vector_iota_entry_index(bt);
assert(length_in_bytes <= 16, "must be");
// The iota indices are ordered by type B/S/I/L/F/D, and the offset between two types is 16.
int offset = exact_log2(type2aelembytes(bt)) << 4;
if (is_floating_point_type(bt)) {
offset += 32;
}
__ lea(rscratch1, ExternalAddress(StubRoutines::aarch64::vector_iota_indices() + offset));
__ lea(rscratch1, ExternalAddress(StubRoutines::aarch64::vector_iota_indices(entry_idx)));
if (length_in_bytes == 16) {
__ ldrq($dst$$FloatRegister, rscratch1);
} else {
Expand Down Expand Up @@ -3406,6 +3433,44 @@ instruct reduce_non_strict_order_add4F_neon(vRegF dst, vRegF fsrc, vReg vsrc, vR
ins_pipe(pipe_slow);
%}

// Add Reduction for Half floats (FP16).
// Neon does not provide direct instructions for strictly ordered floating-point add reductions.
// On Neon-only targets (UseSVE = 0), this operation is implemented as a sequence of scalar additions:
// values equal to the vector width are loaded into a vector register, each lane is extracted,
// and its value is accumulated into the running sum, producing a final scalar result.
instruct reduce_addHF_neon(vRegF dst, vRegF fsrc, vReg vsrc, vReg tmp) %{
predicate(UseSVE == 0);
match(Set dst (AddReductionVHF fsrc vsrc));
effect(TEMP_DEF dst, TEMP tmp);
format %{ "reduce_addHF $dst, $fsrc, $vsrc\t# 4HF/8HF. KILL $tmp" %}
ins_encode %{
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
__ neon_reduce_add_fp16($dst$$FloatRegister, $fsrc$$FloatRegister,
$vsrc$$FloatRegister, length_in_bytes, $tmp$$FloatRegister);
%}
ins_pipe(pipe_slow);
%}

// This rule calculates the reduction result in strict order. Two cases will
// reach here:
// 1. Non strictly-ordered AddReductionVHF when vector size > 128-bits. For example -
// AddReductionVHF generated by Vector API. For vector size > 128-bits, it is more
// beneficial performance-wise to generate direct SVE instruction even if it is
// strictly ordered.
// 2. Strictly-ordered AddReductionVHF. For example - AddReductionVHF generated by
// auto-vectorization on SVE machine.
instruct reduce_addHF_sve(vRegF dst_src1, vReg src2) %{
predicate(UseSVE > 0);
match(Set dst_src1 (AddReductionVHF dst_src1 src2));
format %{ "reduce_addHF_sve $dst_src1, $dst_src1, $src2" %}
ins_encode %{
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src2);
assert(length_in_bytes == MaxVectorSize, "invalid vector length");
__ sve_fadda($dst_src1$$FloatRegister, __ H, ptrue, $src2$$FloatRegister);
%}
ins_pipe(pipe_slow);
%}

// This rule calculates the reduction result in strict order. Two cases will
// reach here:
// 1. Non strictly-ordered AddReductionVF when vector size > 128-bits. For example -
Expand Down Expand Up @@ -3496,12 +3561,14 @@ instruct reduce_addL_masked(iRegLNoSp dst, iRegL isrc, vReg vsrc, pRegGov pg, vR
ins_pipe(pipe_slow);
%}

instruct reduce_addF_masked(vRegF dst_src1, vReg src2, pRegGov pg) %{
instruct reduce_addFHF_masked(vRegF dst_src1, vReg src2, pRegGov pg) %{
predicate(UseSVE > 0);
match(Set dst_src1 (AddReductionVHF (Binary dst_src1 src2) pg));
match(Set dst_src1 (AddReductionVF (Binary dst_src1 src2) pg));
format %{ "reduce_addF_masked $dst_src1, $pg, $dst_src1, $src2" %}
format %{ "reduce_addFHF_masked $dst_src1, $pg, $dst_src1, $src2" %}
ins_encode %{
__ sve_fadda($dst_src1$$FloatRegister, __ S,
BasicType bt = Matcher::vector_element_basic_type(this, $src2);
__ sve_fadda($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt),
$pg$$PRegister, $src2$$FloatRegister);
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -3549,14 +3616,17 @@ instruct reduce_mulL(iRegLNoSp dst, iRegL isrc, vReg vsrc) %{
ins_pipe(pipe_slow);
%}

instruct reduce_mulF(vRegF dst, vRegF fsrc, vReg vsrc, vReg tmp) %{

instruct reduce_mulFHF(vRegF dst, vRegF fsrc, vReg vsrc, vReg tmp) %{
predicate(Matcher::vector_length_in_bytes(n->in(2)) <= 16);
match(Set dst (MulReductionVHF fsrc vsrc));
match(Set dst (MulReductionVF fsrc vsrc));
effect(TEMP_DEF dst, TEMP tmp);
format %{ "reduce_mulF $dst, $fsrc, $vsrc\t# 2F/4F. KILL $tmp" %}
format %{ "reduce_mulFHF $dst, $fsrc, $vsrc\t# 2F/4F/4HF/8HF. KILL $tmp" %}
ins_encode %{
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
__ neon_reduce_mul_fp($dst$$FloatRegister, T_FLOAT, $fsrc$$FloatRegister,
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
__ neon_reduce_mul_fp($dst$$FloatRegister, bt, $fsrc$$FloatRegister,
$vsrc$$FloatRegister, length_in_bytes, $tmp$$FloatRegister);
%}
ins_pipe(pipe_slow);
Expand Down
Loading
Loading