Skip to content

Commit 1c8929a

Browse files
committed
Avoid Vector API conversions involving the f32x2 shape
1 parent 9b7db93 commit 1c8929a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

wasm/src/org.graalvm.wasm.jdk25/src/org/graalvm/wasm/api/Vector128OpsVectorAPI.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,16 @@ public ByteVector unary(ByteVector xVec, int vectorOpcode) {
366366
case Bytecode.VECTOR_F64X2_TRUNC -> trunc(x, F64X2, I64X2, VectorOperators.REINTERPRET_D2L, VectorOperators.REINTERPRET_L2D,
367367
Vector128OpsVectorAPI::getExponentDoubles, DOUBLE_SIGNIFICAND_WIDTH, I64X2.broadcast(DOUBLE_SIGNIF_BIT_MASK));
368368
case Bytecode.VECTOR_F64X2_NEAREST -> nearest(x, F64X2, 1L << (DOUBLE_SIGNIFICAND_WIDTH - 1));
369-
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F32X4_S, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F32X4_S -> I8X16.species().fromArray(fallbackOps.unary(x.toArray(), vectorOpcode), 0); // GR-51421
370-
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F32X4_U, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F32X4_U -> I8X16.species().fromArray(fallbackOps.unary(x.toArray(), vectorOpcode), 0); // GR-51421
369+
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F32X4_S, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F32X4_S -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-51421
370+
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F32X4_U, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F32X4_U -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-51421
371371
case Bytecode.VECTOR_F32X4_CONVERT_I32X4_S -> convert(x, I32X4, VectorOperators.I2F);
372-
case Bytecode.VECTOR_F32X4_CONVERT_I32X4_U -> f32x4_convert_i32x4_u(x);
373-
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F64X2_S_ZERO, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F64X2_S_ZERO -> I8X16.species().fromArray(fallbackOps.unary(x.toArray(), vectorOpcode), 0); // GR-51421
374-
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F64X2_U_ZERO, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F64X2_U_ZERO -> I8X16.species().fromArray(fallbackOps.unary(x.toArray(), vectorOpcode), 0); // GR-51421
372+
case Bytecode.VECTOR_F32X4_CONVERT_I32X4_U -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-68843
373+
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F64X2_S_ZERO, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F64X2_S_ZERO -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-51421
374+
case Bytecode.VECTOR_I32X4_TRUNC_SAT_F64X2_U_ZERO, Bytecode.VECTOR_I32X4_RELAXED_TRUNC_F64X2_U_ZERO -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-51421
375375
case Bytecode.VECTOR_F64X2_CONVERT_LOW_I32X4_S -> convert(x, I32X4, VectorOperators.I2D);
376376
case Bytecode.VECTOR_F64X2_CONVERT_LOW_I32X4_U -> f64x2_convert_low_i32x4_u(x);
377-
case Bytecode.VECTOR_F32X4_DEMOTE_F64X2_ZERO -> f32X4_demote_f64X2_zero(x);
378-
case Bytecode.VECTOR_F64X2_PROMOTE_LOW_F32X4 -> convert(x, F32X4, VectorOperators.F2D);
377+
case Bytecode.VECTOR_F32X4_DEMOTE_F64X2_ZERO -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-68843
378+
case Bytecode.VECTOR_F64X2_PROMOTE_LOW_F32X4 -> fromArray(fallbackOps.unary(x.toArray(), vectorOpcode)); // GR-68843
379379
default -> throw CompilerDirectives.shouldNotReachHere();
380380
});
381381
}
@@ -889,6 +889,7 @@ private static ByteVector i32x4_trunc_sat_f32x4_u(ByteVector xBytes) {
889889
return result.reinterpretAsBytes();
890890
}
891891

892+
@SuppressWarnings("unused")
892893
private static ByteVector f32x4_convert_i32x4_u(ByteVector xBytes) {
893894
IntVector x = xBytes.reinterpretAsInts();
894895
LongVector xUnsignedLow = castLong128(x.convert(VectorOperators.ZERO_EXTEND_I2L, 0));
@@ -915,6 +916,7 @@ private static ByteVector f64x2_convert_low_i32x4_u(ByteVector xBytes) {
915916
return result.reinterpretAsBytes();
916917
}
917918

919+
@SuppressWarnings("unused")
918920
private static ByteVector f32X4_demote_f64X2_zero(ByteVector xBytes) {
919921
DoubleVector x = F64X2.reinterpret(xBytes);
920922
Vector<Float> result = compactGeneral(x, 0, I64X2, F32X4, VectorOperators.D2F, VectorOperators.REINTERPRET_F2I, VectorOperators.ZERO_EXTEND_I2L);

0 commit comments

Comments
 (0)