Skip to content

Commit f5feca5

Browse files
author
Datadog Syncup Service
committed
Merge branch 'upstream-master'
2 parents 3e92c9b + f71d515 commit f5feca5

File tree

1,356 files changed

+7413
-4244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,356 files changed

+7413
-4244
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -640,23 +640,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
640640
# Linking is different on macOS
641641
JVM_PICFLAG=""
642642
fi
643-
644-
# Extra flags needed when building optional static versions of certain
645-
# JDK libraries.
646-
STATIC_LIBS_CFLAGS="-DSTATIC_BUILD=1"
647-
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
648-
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections \
649-
-DJNIEXPORT='__attribute__((visibility(\"default\")))'"
650-
else
651-
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -DJNIEXPORT="
652-
fi
653-
if test "x$TOOLCHAIN_TYPE" = xgcc; then
654-
# Disable relax-relocation to enable compatibility with older linkers
655-
RELAX_RELOCATIONS_FLAG="-Xassembler -mrelax-relocations=no"
656-
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${RELAX_RELOCATIONS_FLAG}],
657-
IF_TRUE: [STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS ${RELAX_RELOCATIONS_FLAG}"])
658-
fi
659-
AC_SUBST(STATIC_LIBS_CFLAGS)
660643
])
661644

662645
################################################################################

make/autoconf/spec.gmk.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,6 @@ LIBFFI_LIB_FILE := @LIBFFI_LIB_FILE@
429429
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
430430
REPRODUCIBLE_CFLAGS := @REPRODUCIBLE_CFLAGS@
431431

432-
STATIC_LIBS_CFLAGS := @STATIC_LIBS_CFLAGS@
433-
434432
JMH_CORE_JAR := @JMH_CORE_JAR@
435433
JMH_GENERATOR_JAR := @JMH_GENERATOR_JAR@
436434
JMH_JOPT_SIMPLE_JAR := @JMH_JOPT_SIMPLE_JAR@

make/common/native/Flags.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ define SetupCompilerFlags
9999
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
100100
endif
101101
ifeq ($(STATIC_LIBS), true)
102-
$1_EXTRA_CFLAGS += $$(STATIC_LIBS_CFLAGS)
102+
$1_EXTRA_CFLAGS += -DSTATIC_BUILD=1
103103
endif
104104

105105
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and/or TOOLCHAIN_TYPE

src/demo/share/java2d/J2DBench/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions

src/demo/share/java2d/J2DBench/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
33
44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions

src/hotspot/cpu/aarch64/aarch64_vector.ad

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ source %{
320320
}
321321
}
322322

323+
bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
324+
return false;
325+
}
326+
323327
// Assert that the given node is not a variable shift.
324328
bool assert_not_var_shift(const Node* n) {
325329
assert(!n->as_ShiftV()->is_var_shift(), "illegal variable shift");
@@ -6150,41 +6154,6 @@ instruct vtest_alltrue_sve(rFlagsReg cr, pReg src1, pReg src2, pReg ptmp) %{
61506154
ins_pipe(pipe_slow);
61516155
%}
61526156

6153-
// ------------------------------ Vector shuffle -------------------------------
6154-
6155-
instruct loadshuffle(vReg dst, vReg src) %{
6156-
match(Set dst (VectorLoadShuffle src));
6157-
format %{ "loadshuffle $dst, $src" %}
6158-
ins_encode %{
6159-
BasicType bt = Matcher::vector_element_basic_type(this);
6160-
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
6161-
if (bt == T_BYTE) {
6162-
if ($dst$$FloatRegister != $src$$FloatRegister) {
6163-
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
6164-
__ orr($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
6165-
$src$$FloatRegister, $src$$FloatRegister);
6166-
} else {
6167-
assert(UseSVE > 0, "must be sve");
6168-
__ sve_orr($dst$$FloatRegister, $src$$FloatRegister, $src$$FloatRegister);
6169-
}
6170-
}
6171-
} else {
6172-
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
6173-
// 4S/8S, 4I, 4F
6174-
__ uxtl($dst$$FloatRegister, __ T8H, $src$$FloatRegister, __ T8B);
6175-
if (type2aelembytes(bt) == 4) {
6176-
__ uxtl($dst$$FloatRegister, __ T4S, $dst$$FloatRegister, __ T4H);
6177-
}
6178-
} else {
6179-
assert(UseSVE > 0, "must be sve");
6180-
__ sve_vector_extend($dst$$FloatRegister, __ elemType_to_regVariant(bt),
6181-
$src$$FloatRegister, __ B);
6182-
}
6183-
}
6184-
%}
6185-
ins_pipe(pipe_slow);
6186-
%}
6187-
61886157
// ------------------------------ Vector rearrange -----------------------------
61896158

61906159
// Here is an example that rearranges a NEON vector with 4 ints:
@@ -6207,6 +6176,7 @@ instruct loadshuffle(vReg dst, vReg src) %{
62076176
// need to lookup 2/4 bytes as a group. For VectorRearrange long, we use bsl
62086177
// to implement rearrange.
62096178

6179+
// Maybe move the shuffle preparation to VectorLoadShuffle
62106180
instruct rearrange_HS_neon(vReg dst, vReg src, vReg shuffle, vReg tmp1, vReg tmp2) %{
62116181
predicate(UseSVE == 0 &&
62126182
(Matcher::vector_element_basic_type(n) == T_SHORT ||

src/hotspot/cpu/aarch64/aarch64_vector_ad.m4

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ source %{
310310
}
311311
}
312312

313+
bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
314+
return false;
315+
}
316+
313317
// Assert that the given node is not a variable shift.
314318
bool assert_not_var_shift(const Node* n) {
315319
assert(!n->as_ShiftV()->is_var_shift(), "illegal variable shift");
@@ -4397,41 +4401,6 @@ instruct vtest_alltrue_sve(rFlagsReg cr, pReg src1, pReg src2, pReg ptmp) %{
43974401
ins_pipe(pipe_slow);
43984402
%}
43994403

4400-
// ------------------------------ Vector shuffle -------------------------------
4401-
4402-
instruct loadshuffle(vReg dst, vReg src) %{
4403-
match(Set dst (VectorLoadShuffle src));
4404-
format %{ "loadshuffle $dst, $src" %}
4405-
ins_encode %{
4406-
BasicType bt = Matcher::vector_element_basic_type(this);
4407-
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
4408-
if (bt == T_BYTE) {
4409-
if ($dst$$FloatRegister != $src$$FloatRegister) {
4410-
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
4411-
__ orr($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
4412-
$src$$FloatRegister, $src$$FloatRegister);
4413-
} else {
4414-
assert(UseSVE > 0, "must be sve");
4415-
__ sve_orr($dst$$FloatRegister, $src$$FloatRegister, $src$$FloatRegister);
4416-
}
4417-
}
4418-
} else {
4419-
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
4420-
// 4S/8S, 4I, 4F
4421-
__ uxtl($dst$$FloatRegister, __ T8H, $src$$FloatRegister, __ T8B);
4422-
if (type2aelembytes(bt) == 4) {
4423-
__ uxtl($dst$$FloatRegister, __ T4S, $dst$$FloatRegister, __ T4H);
4424-
}
4425-
} else {
4426-
assert(UseSVE > 0, "must be sve");
4427-
__ sve_vector_extend($dst$$FloatRegister, __ elemType_to_regVariant(bt),
4428-
$src$$FloatRegister, __ B);
4429-
}
4430-
}
4431-
%}
4432-
ins_pipe(pipe_slow);
4433-
%}
4434-
44354404
// ------------------------------ Vector rearrange -----------------------------
44364405

44374406
// Here is an example that rearranges a NEON vector with 4 ints:
@@ -4454,6 +4423,7 @@ instruct loadshuffle(vReg dst, vReg src) %{
44544423
// need to lookup 2/4 bytes as a group. For VectorRearrange long, we use bsl
44554424
// to implement rearrange.
44564425

4426+
// Maybe move the shuffle preparation to VectorLoadShuffle
44574427
instruct rearrange_HS_neon(vReg dst, vReg src, vReg shuffle, vReg tmp1, vReg tmp2) %{
44584428
predicate(UseSVE == 0 &&
44594429
(Matcher::vector_element_basic_type(n) == T_SHORT ||

src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,18 +277,20 @@ void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr bas
277277

278278

279279
bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
280-
281-
if (is_power_of_2(c - 1)) {
282-
__ shift_left(left, exact_log2(c - 1), tmp);
280+
juint u_value = (juint)c;
281+
if (is_power_of_2(u_value - 1)) {
282+
__ shift_left(left, exact_log2(u_value - 1), tmp);
283283
__ add(tmp, left, result);
284284
return true;
285-
} else if (is_power_of_2(c + 1)) {
286-
__ shift_left(left, exact_log2(c + 1), tmp);
285+
} else if (is_power_of_2(u_value + 1)) {
286+
__ shift_left(left, exact_log2(u_value + 1), tmp);
287287
__ sub(tmp, left, result);
288288
return true;
289-
} else {
290-
return false;
289+
} else if (c == -1) {
290+
__ negate(left, result);
291+
return true;
291292
}
293+
return false;
292294
}
293295

294296
void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
@@ -777,11 +779,13 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
777779
}
778780
case vmIntrinsics::_floatToFloat16: {
779781
LIR_Opr tmp = new_register(T_FLOAT);
782+
__ move(LIR_OprFact::floatConst(-0.0), tmp);
780783
__ f2hf(src, dst, tmp);
781784
break;
782785
}
783786
case vmIntrinsics::_float16ToFloat: {
784787
LIR_Opr tmp = new_register(T_FLOAT);
788+
__ move(LIR_OprFact::floatConst(-0.0), tmp);
785789
__ hf2f(src, dst, tmp);
786790
break;
787791
}

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
14791479

14801480
BasicType* out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_c_args);
14811481
VMRegPair* out_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_c_args);
1482-
BasicType* in_elem_bt = nullptr;
14831482

14841483
int argc = 0;
14851484
out_sig_bt[argc++] = T_ADDRESS;
@@ -1668,15 +1667,12 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
16681667

16691668
// For JNI natives the incoming and outgoing registers are offset upwards.
16701669
GrowableArray<int> arg_order(2 * total_in_args);
1671-
VMRegPair tmp_vmreg;
1672-
tmp_vmreg.set2(r19->as_VMReg());
16731670

16741671
for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) {
16751672
arg_order.push(i);
16761673
arg_order.push(c_arg);
16771674
}
16781675

1679-
int temploc = -1;
16801676
for (int ai = 0; ai < arg_order.length(); ai += 2) {
16811677
int i = arg_order.at(ai);
16821678
int c_arg = arg_order.at(ai + 1);
@@ -1892,7 +1888,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
18921888
}
18931889

18941890
Label safepoint_in_progress, safepoint_in_progress_done;
1895-
Label after_transition;
18961891

18971892
// Switch thread to "native transition" state before reading the synchronization state.
18981893
// This additional state is necessary because reading and testing the synchronization
@@ -1925,7 +1920,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
19251920
__ mov(rscratch1, _thread_in_Java);
19261921
__ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
19271922
__ stlrw(rscratch1, rscratch2);
1928-
__ bind(after_transition);
19291923

19301924
if (LockingMode != LM_LEGACY && method->is_object_wait0()) {
19311925
// Check preemption for Object.wait()

src/hotspot/cpu/arm/arm.ad

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,10 @@ bool Matcher::vector_needs_partial_operations(Node* node, const TypeVect* vt) {
999999
return false;
10001000
}
10011001

1002+
bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
1003+
return false;
1004+
}
1005+
10021006
const RegMask* Matcher::predicate_reg_mask(void) {
10031007
return nullptr;
10041008
}

0 commit comments

Comments
 (0)