Skip to content

Commit 041a915

Browse files
committed
[GR-71062] Fix check for AVX512 use in AMD64VectorConvertFloatToIntegerOp
PullRequest: graal/22490
2 parents 9bce1a9 + 418fb02 commit 041a915

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/vector/AMD64VectorConvertFloatToIntegerOp.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public class AMD64VectorConvertFloatToIntegerOp extends AMD64VectorInstruction {
9393
@Temp({REG, ILLEGAL}) protected Value compareMaskValue;
9494

9595
private final OpcodeEmitter emitter;
96+
private final AMD64Assembler.AMD64SIMDInstructionEncoding encoding;
9697
private final boolean canBeNaN;
9798
private final boolean canOverflow;
9899

@@ -108,9 +109,10 @@ public AMD64VectorConvertFloatToIntegerOp(LIRGeneratorTool tool, OpcodeEmitter e
108109
this.dstValue = dstValue;
109110
this.srcValue = srcValue;
110111
this.emitter = emitter;
112+
this.encoding = AMD64Assembler.AMD64SIMDInstructionEncoding.forFeatures(((AMD64) tool.target().arch).getFeatures());
111113
if (canBeNaN || canOverflow) {
112114
AMD64Kind maskKind;
113-
if (((AMD64) tool.target().arch).getFeatures().contains(AMD64.CPUFeature.AVX512F)) {
115+
if (this.encoding == AMD64Assembler.AMD64SIMDInstructionEncoding.EVEX) {
114116
GraalError.guarantee(Math.max(dstValue.getPlatformKind().getVectorLength(), srcValue.getPlatformKind().getVectorLength()) <= 16, "expect at most 16-element vectors");
115117
maskKind = AMD64Kind.MASK16;
116118
} else {
@@ -130,7 +132,7 @@ public AMD64VectorConvertFloatToIntegerOp(LIRGeneratorTool tool, OpcodeEmitter e
130132

131133
@Override
132134
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
133-
if (masm.getFeatures().contains(AMD64.CPUFeature.AVX512F)) {
135+
if (this.encoding == AMD64Assembler.AMD64SIMDInstructionEncoding.EVEX) {
134136
GraalError.guarantee(masm.supportsFullAVX512(), "expect full AVX-512 support");
135137
emitAVX512(crb, masm);
136138
} else {

0 commit comments

Comments
 (0)