Skip to content

Commit ac02afe

Browse files
author
Jatin Bhateja
committed
8253721: Flag -XX:AVX3Threshold does not accept Zero value
Reviewed-by: kvn, thartmann
1 parent 4d9f207 commit ac02afe

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

src/hotspot/cpu/x86/globals_x86.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
213213
"for copy, inflate and fill. When this value is set as zero" \
214214
"compare operations can also use AVX512 intrinsics.") \
215215
range(0, max_jint) \
216+
constraint(AVX3ThresholdConstraintFunc,AfterErgo) \
216217
\
217218
product(bool, IntelJccErratumMitigation, true, DIAGNOSTIC, \
218219
"Turn off JVM mitigations related to Intel micro code " \

src/hotspot/cpu/x86/vm_version_x86.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,13 +1162,6 @@ void VM_Version::get_processor_features() {
11621162
}
11631163
#endif // COMPILER2 && ASSERT
11641164

1165-
if (!FLAG_IS_DEFAULT(AVX3Threshold)) {
1166-
if (!is_power_of_2(AVX3Threshold)) {
1167-
warning("AVX3Threshold must be a power of 2");
1168-
FLAG_SET_DEFAULT(AVX3Threshold, 4096);
1169-
}
1170-
}
1171-
11721165
#ifdef _LP64
11731166
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
11741167
UseMultiplyToLenIntrinsic = true;

src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,17 @@ JVMFlag::Error ArraycopyDstPrefetchDistanceConstraintFunc(uintx value, bool verb
285285
return JVMFlag::SUCCESS;
286286
}
287287

288+
JVMFlag::Error AVX3ThresholdConstraintFunc(int value, bool verbose) {
289+
if (value != 0 && !is_power_of_2(value)) {
290+
JVMFlag::printError(verbose,
291+
"AVX3Threshold ( %d ) must be 0 or "
292+
"a power of two value between 0 and MAX_INT\n", value);
293+
return JVMFlag::VIOLATES_CONSTRAINT;
294+
}
295+
296+
return JVMFlag::SUCCESS;
297+
}
298+
288299
JVMFlag::Error ArraycopySrcPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
289300
if (value >= 4032) {
290301
JVMFlag::printError(verbose,

src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
f(intx, OptoLoopAlignmentConstraintFunc) \
4848
f(uintx, ArraycopyDstPrefetchDistanceConstraintFunc) \
4949
f(uintx, ArraycopySrcPrefetchDistanceConstraintFunc) \
50+
f(int, AVX3ThresholdConstraintFunc) \
5051
f(uintx, TypeProfileLevelConstraintFunc) \
5152
f(intx, InitArrayShortSizeConstraintFunc) \
5253
f(int , RTMTotalCountIncrRateConstraintFunc) \

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public final class AMD64ArrayCompareToOp extends AMD64LIRInstruction {
8484
public AMD64ArrayCompareToOp(LIRGeneratorTool tool, int useAVX3Threshold, JavaKind kind1, JavaKind kind2, Value result, Value array1, Value array2, Value length1, Value length2) {
8585
super(TYPE);
8686

87-
assert CodeUtil.isPowerOf2(useAVX3Threshold) : "AVX3Threshold must be power of 2";
8887
this.useAVX3Threshold = useAVX3Threshold;
8988
this.kind1 = kind1;
9089
this.kind2 = kind2;

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringLatin1InflateOp.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public final class AMD64StringLatin1InflateOp extends AMD64LIRInstruction {
7171
public AMD64StringLatin1InflateOp(LIRGeneratorTool tool, int useAVX3Threshold, Value src, Value dst, Value len) {
7272
super(TYPE);
7373

74-
assert CodeUtil.isPowerOf2(useAVX3Threshold) : "AVX3Threshold must be power of 2";
7574
this.useAVX3Threshold = useAVX3Threshold;
7675

7776
assert asRegister(src).equals(rsi);

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringUTF16CompressOp.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public final class AMD64StringUTF16CompressOp extends AMD64LIRInstruction {
7676
public AMD64StringUTF16CompressOp(LIRGeneratorTool tool, int useAVX3Threshold, Value res, Value src, Value dst, Value len) {
7777
super(TYPE);
7878

79-
assert CodeUtil.isPowerOf2(useAVX3Threshold) : "AVX3Threshold must be power of 2";
8079
this.useAVX3Threshold = useAVX3Threshold;
8180

8281
assert asRegister(src).equals(rsi);

0 commit comments

Comments
 (0)