diff --git a/clang/include/clang/Basic/BuiltinsWebAssembly.def b/clang/include/clang/Basic/BuiltinsWebAssembly.def --- a/clang/include/clang/Basic/BuiltinsWebAssembly.def +++ b/clang/include/clang/Basic/BuiltinsWebAssembly.def @@ -153,8 +153,6 @@ TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i32x4_f32x4, "V4iV4f", "nc", "simd128") TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i32x4_f32x4, "V4iV4f", "nc", "simd128") -TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i64x2_f64x2, "V2LLiV2d", "nc", "unimplemented-simd128") -TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i64x2_f64x2, "V2LLiV2d", "nc", "unimplemented-simd128") TARGET_BUILTIN(__builtin_wasm_narrow_s_i8x16_i16x8, "V16cV8sV8s", "nc", "simd128") TARGET_BUILTIN(__builtin_wasm_narrow_u_i8x16_i16x8, "V16cV8sV8s", "nc", "simd128") diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -15546,8 +15546,7 @@ case WebAssembly::BI__builtin_wasm_trunc_saturate_s_i32_f64: case WebAssembly::BI__builtin_wasm_trunc_saturate_s_i64_f32: case WebAssembly::BI__builtin_wasm_trunc_saturate_s_i64_f64: - case WebAssembly::BI__builtin_wasm_trunc_saturate_s_i32x4_f32x4: - case WebAssembly::BI__builtin_wasm_trunc_saturate_s_i64x2_f64x2: { + case WebAssembly::BI__builtin_wasm_trunc_saturate_s_i32x4_f32x4: { Value *Src = EmitScalarExpr(E->getArg(0)); llvm::Type *ResT = ConvertType(E->getType()); Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_trunc_saturate_signed, @@ -15558,8 +15557,7 @@ case WebAssembly::BI__builtin_wasm_trunc_saturate_u_i32_f64: case WebAssembly::BI__builtin_wasm_trunc_saturate_u_i64_f32: case WebAssembly::BI__builtin_wasm_trunc_saturate_u_i64_f64: - case WebAssembly::BI__builtin_wasm_trunc_saturate_u_i32x4_f32x4: - case WebAssembly::BI__builtin_wasm_trunc_saturate_u_i64x2_f64x2: { + case WebAssembly::BI__builtin_wasm_trunc_saturate_u_i32x4_f32x4: { Value *Src = EmitScalarExpr(E->getArg(0)); llvm::Type *ResT = ConvertType(E->getType()); Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_trunc_saturate_unsigned, diff --git a/clang/lib/Headers/wasm_simd128.h b/clang/lib/Headers/wasm_simd128.h --- a/clang/lib/Headers/wasm_simd128.h +++ b/clang/lib/Headers/wasm_simd128.h @@ -1007,20 +1007,6 @@ return (v128_t)__builtin_wasm_trunc_saturate_u_i32x4_f32x4((__f32x4)__a); } -#ifdef __wasm_unimplemented_simd128__ - -static __inline__ v128_t __DEFAULT_FN_ATTRS -wasm_i64x2_trunc_saturate_f64x2(v128_t __a) { - return (v128_t)__builtin_wasm_trunc_saturate_s_i64x2_f64x2((__f64x2)__a); -} - -static __inline__ v128_t __DEFAULT_FN_ATTRS -wasm_u64x2_trunc_saturate_f64x2(v128_t __a) { - return (v128_t)__builtin_wasm_trunc_saturate_s_i64x2_f64x2((__f64x2)__a); -} - -#endif // __wasm_unimplemented_simd128__ - static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f32x4_convert_i32x4(v128_t __a) { return (v128_t) __builtin_convertvector((__i32x4)__a, __f32x4); @@ -1031,20 +1017,6 @@ return (v128_t) __builtin_convertvector((__u32x4)__a, __f32x4); } -#ifdef __wasm_unimplemented_simd128__ - -static __inline__ v128_t __DEFAULT_FN_ATTRS -wasm_f64x2_convert_i64x2(v128_t __a) { - return (v128_t) __builtin_convertvector((__i64x2)__a, __f64x2); -} - -static __inline__ v128_t __DEFAULT_FN_ATTRS -wasm_f64x2_convert_u64x2(v128_t __a) { - return (v128_t) __builtin_convertvector((__u64x2)__a, __f64x2); -} - -#endif // __wasm_unimplemented_simd128__ - #define wasm_v8x16_shuffle(__a, __b, __c0, __c1, __c2, __c3, __c4, __c5, __c6, \ __c7, __c8, __c9, __c10, __c11, __c12, __c13, \ __c14, __c15) \ diff --git a/clang/test/CodeGen/builtins-wasm.c b/clang/test/CodeGen/builtins-wasm.c --- a/clang/test/CodeGen/builtins-wasm.c +++ b/clang/test/CodeGen/builtins-wasm.c @@ -645,18 +645,6 @@ // WEBASSEMBLY-NEXT: ret } -i64x2 trunc_saturate_s_i64x2_f64x2(f64x2 f) { - return __builtin_wasm_trunc_saturate_s_i64x2_f64x2(f); - // WEBASSEMBLY: call <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double> %f) - // WEBASSEMBLY-NEXT: ret -} - -i64x2 trunc_saturate_u_i64x2_f64x2(f64x2 f) { - return __builtin_wasm_trunc_saturate_u_i64x2_f64x2(f); - // WEBASSEMBLY: call <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double> %f) - // WEBASSEMBLY-NEXT: ret -} - i8x16 narrow_s_i8x16_i16x8(i16x8 low, i16x8 high) { return __builtin_wasm_narrow_s_i8x16_i16x8(low, high); // WEBASSEMBLY: call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16( diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -183,11 +183,10 @@ setCondCodeAction(static_cast(CC), MVT::v2i64, Custom); // 64x2 conversions are not in the spec - if (!Subtarget->hasUnimplementedSIMD128()) - for (auto Op : - {ISD::SINT_TO_FP, ISD::UINT_TO_FP, ISD::FP_TO_SINT, ISD::FP_TO_UINT}) - for (auto T : {MVT::v2i64, MVT::v2f64}) - setOperationAction(Op, T, Expand); + for (auto Op : + {ISD::SINT_TO_FP, ISD::UINT_TO_FP, ISD::FP_TO_SINT, ISD::FP_TO_UINT}) + for (auto T : {MVT::v2i64, MVT::v2f64}) + setOperationAction(Op, T, Expand); } // As a special case, these operators use the type to mean the type to diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -67,10 +67,10 @@ vec#".load_splat\t$off$p2align", simdop>; } -defm "" : SIMDLoadSplat<"v8x16", 194>; -defm "" : SIMDLoadSplat<"v16x8", 195>; -defm "" : SIMDLoadSplat<"v32x4", 196>; -defm "" : SIMDLoadSplat<"v64x2", 197>; +defm "" : SIMDLoadSplat<"v8x16", 7>; +defm "" : SIMDLoadSplat<"v16x8", 8>; +defm "" : SIMDLoadSplat<"v32x4", 9>; +defm "" : SIMDLoadSplat<"v64x2", 10>; def wasm_load_splat_t : SDTypeProfile<1, 1, [SDTCisPtrTy<1>]>; def wasm_load_splat : SDNode<"WebAssemblyISD::LOAD_SPLAT", wasm_load_splat_t, @@ -116,9 +116,9 @@ } } -defm "" : SIMDLoadExtend; -defm "" : SIMDLoadExtend; -defm "" : SIMDLoadExtend; +defm "" : SIMDLoadExtend; +defm "" : SIMDLoadExtend; +defm "" : SIMDLoadExtend; let Predicates = [HasUnimplementedSIMD128] in foreach types = [[v8i16, i8], [v4i32, i16], [v2i64, i32]] in @@ -144,7 +144,7 @@ SIMD_I<(outs), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, V128:$vec), (outs), (ins P2Align:$p2align, offset32_op:$off), [], "v128.store\t${off}(${addr})$p2align, $vec", - "v128.store\t$off$p2align", 1>; + "v128.store\t$off$p2align", 11>; foreach vec_t = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in { // Def load and store patterns from WebAssemblyInstrMemory.td for vector types @@ -166,7 +166,7 @@ defm CONST_V128_#vec_t : SIMD_I<(outs V128:$dst), ops, (outs), ops, [(set V128:$dst, (vec_t pat))], "v128.const\t$dst, "#args, - "v128.const\t"#args, 2>; + "v128.const\t"#args, 12>; } defm "" : ConstVec; + 13>; // Shuffles after custom lowering def wasm_shuffle_t : SDTypeProfile<1, 18, []>; @@ -278,7 +278,7 @@ SIMD_I<(outs V128:$dst), (ins V128:$src, V128:$mask), (outs), (ins), [(set (v16i8 V128:$dst), (wasm_swizzle (v16i8 V128:$src), (v16i8 V128:$mask)))], - "v8x16.swizzle\t$dst, $src, $mask", "v8x16.swizzle", 192>; + "v8x16.swizzle\t$dst, $src, $mask", "v8x16.swizzle", 14>; def : Pat<(int_wasm_swizzle (v16i8 V128:$src), (v16i8 V128:$mask)), (SWIZZLE V128:$src, V128:$mask)>; @@ -305,12 +305,12 @@ vec#".splat\t$dst, $x", vec#".splat", simdop>; } -defm "" : Splat; -defm "" : Splat; -defm "" : Splat; -defm "" : Splat; -defm "" : Splat; -defm "" : Splat; +defm "" : Splat; +defm "" : Splat; +defm "" : Splat; +defm "" : Splat; +defm "" : Splat; +defm "" : Splat; // scalar_to_vector leaves high lanes undefined, so can be a splat class ScalarSplatPat; } -defm "" : ExtractLane; -defm "" : ExtractLane; -defm "" : ExtractLane; -defm "" : ExtractLane; -defm "" : ExtractLane; -defm "" : ExtractLane; -defm "" : ExtractLane; -defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; +defm "" : ExtractLane; def : Pat<(vector_extract (v16i8 V128:$vec), (i32 LaneIdx16:$idx)), (EXTRACT_LANE_v16i8_u V128:$vec, imm:$idx)>; @@ -387,12 +387,12 @@ vec#".replace_lane\t$idx", simdop>; } -defm "" : ReplaceLane; -defm "" : ReplaceLane; -defm "" : ReplaceLane; -defm "" : ReplaceLane; -defm "" : ReplaceLane; -defm "" : ReplaceLane; +defm "" : ReplaceLane; +defm "" : ReplaceLane; +defm "" : ReplaceLane; +defm "" : ReplaceLane; +defm "" : ReplaceLane; +defm "" : ReplaceLane; // Lower undef lane indices to zero def : Pat<(vector_insert (v16i8 V128:$vec), I32:$x, undef), @@ -438,35 +438,35 @@ // Equality: eq let isCommutable = 1 in { -defm EQ : SIMDConditionInt<"eq", SETEQ, 24>; -defm EQ : SIMDConditionFP<"eq", SETOEQ, 64>; +defm EQ : SIMDConditionInt<"eq", SETEQ, 35>; +defm EQ : SIMDConditionFP<"eq", SETOEQ, 65>; } // isCommutable = 1 // Non-equality: ne let isCommutable = 1 in { -defm NE : SIMDConditionInt<"ne", SETNE, 25>; -defm NE : SIMDConditionFP<"ne", SETUNE, 65>; +defm NE : SIMDConditionInt<"ne", SETNE, 36>; +defm NE : SIMDConditionFP<"ne", SETUNE, 66>; } // isCommutable = 1 // Less than: lt_s / lt_u / lt -defm LT_S : SIMDConditionInt<"lt_s", SETLT, 26>; -defm LT_U : SIMDConditionInt<"lt_u", SETULT, 27>; -defm LT : SIMDConditionFP<"lt", SETOLT, 66>; +defm LT_S : SIMDConditionInt<"lt_s", SETLT, 37>; +defm LT_U : SIMDConditionInt<"lt_u", SETULT, 38>; +defm LT : SIMDConditionFP<"lt", SETOLT, 67>; // Greater than: gt_s / gt_u / gt -defm GT_S : SIMDConditionInt<"gt_s", SETGT, 28>; -defm GT_U : SIMDConditionInt<"gt_u", SETUGT, 29>; -defm GT : SIMDConditionFP<"gt", SETOGT, 67>; +defm GT_S : SIMDConditionInt<"gt_s", SETGT, 39>; +defm GT_U : SIMDConditionInt<"gt_u", SETUGT, 40>; +defm GT : SIMDConditionFP<"gt", SETOGT, 68>; // Less than or equal: le_s / le_u / le -defm LE_S : SIMDConditionInt<"le_s", SETLE, 30>; -defm LE_U : SIMDConditionInt<"le_u", SETULE, 31>; -defm LE : SIMDConditionFP<"le", SETOLE, 68>; +defm LE_S : SIMDConditionInt<"le_s", SETLE, 41>; +defm LE_U : SIMDConditionInt<"le_u", SETULE, 42>; +defm LE : SIMDConditionFP<"le", SETOLE, 69>; // Greater than or equal: ge_s / ge_u / ge -defm GE_S : SIMDConditionInt<"ge_s", SETGE, 32>; -defm GE_U : SIMDConditionInt<"ge_u", SETUGE, 33>; -defm GE : SIMDConditionFP<"ge", SETOGE, 69>; +defm GE_S : SIMDConditionInt<"ge_s", SETGE, 43>; +defm GE_U : SIMDConditionInt<"ge_u", SETUGE, 44>; +defm GE : SIMDConditionFP<"ge", SETOGE, 70>; // Lower float comparisons that don't care about NaN to standard WebAssembly // float comparisons. These instructions are generated with nnan and in the @@ -515,19 +515,19 @@ // Bitwise logic: v128.not foreach vec_t = [v16i8, v8i16, v4i32, v2i64] in -defm NOT: SIMDUnary; +defm NOT: SIMDUnary; -// Bitwise logic: v128.and / v128.or / v128.xor +// Bitwise logic: v128.and / v128.andnot / v128.or / v128.xor let isCommutable = 1 in { -defm AND : SIMDBitwise; -defm OR : SIMDBitwise; -defm XOR : SIMDBitwise; +defm AND : SIMDBitwise; +defm OR : SIMDBitwise; +defm XOR : SIMDBitwise; } // isCommutable = 1 // Bitwise logic: v128.andnot def andnot : PatFrag<(ops node:$left, node:$right), (and $left, (vnot $right))>; let Predicates = [HasUnimplementedSIMD128] in -defm ANDNOT : SIMDBitwise; +defm ANDNOT : SIMDBitwise; // Bitwise select: v128.bitselect foreach vec_t = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in @@ -538,7 +538,7 @@ (vec_t V128:$v1), (vec_t V128:$v2), (vec_t V128:$c) )) )], - "v128.bitselect\t$dst, $v1, $v2, $c", "v128.bitselect", 80>; + "v128.bitselect\t$dst, $v1, $v2, $c", "v128.bitselect", 82>; // Bitselect is equivalent to (c & v1) | (~c & v2) foreach vec_t = [v16i8, v8i16, v4i32, v2i64] in @@ -553,9 +553,9 @@ multiclass SIMDUnaryInt baseInst> { defm "" : SIMDUnary; - defm "" : SIMDUnary; - defm "" : SIMDUnary; - defm "" : SIMDUnary; + defm "" : SIMDUnary; + defm "" : SIMDUnary; + defm "" : SIMDUnary; } multiclass SIMDReduceVec baseInst> { defm "" : SIMDReduceVec; - defm "" : SIMDReduceVec; - defm "" : SIMDReduceVec; - defm "" : SIMDReduceVec; + defm "" : SIMDReduceVec; + defm "" : SIMDReduceVec; + defm "" : SIMDReduceVec; } // Integer vector negation def ivneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>; // Integer absolute value: abs -defm ABS : SIMDUnary; -defm ABS : SIMDUnary; -defm ABS : SIMDUnary; +defm ABS : SIMDUnaryInt; // Integer negation: neg -defm NEG : SIMDUnaryInt; +defm NEG : SIMDUnaryInt; // Any lane true: any_true -defm ANYTRUE : SIMDReduce; +defm ANYTRUE : SIMDReduce; // All lanes true: all_true -defm ALLTRUE : SIMDReduce; +defm ALLTRUE : SIMDReduce; // Reductions already return 0 or 1, so and 1, setne 0, and seteq 1 // can be folded out @@ -619,9 +617,9 @@ vec#".bitmask\t$dst, $vec", vec#".bitmask", simdop>; } -defm BITMASK : SIMDBitmask; -defm BITMASK : SIMDBitmask; -defm BITMASK : SIMDBitmask; +defm BITMASK : SIMDBitmask; +defm BITMASK : SIMDBitmask; +defm BITMASK : SIMDBitmask; //===----------------------------------------------------------------------===// // Bit shifts @@ -639,19 +637,19 @@ multiclass SIMDShiftInt baseInst> { defm "" : SIMDShift; defm "" : SIMDShift; + !add(baseInst, 32)>; defm "" : SIMDShift; + !add(baseInst, 64)>; defm "" : SIMDShift; + name, !add(baseInst, 96)>; } // Left shift by scalar: shl -defm SHL : SIMDShiftInt; +defm SHL : SIMDShiftInt; // Right shift by scalar: shr_s / shr_u -defm SHR_S : SIMDShiftInt; -defm SHR_U : SIMDShiftInt; +defm SHR_S : SIMDShiftInt; +defm SHR_U : SIMDShiftInt; // Truncate i64 shift operands to i32s, except if they are already i32s foreach shifts = [[shl, SHL_v2i64], [sra, SHR_S_v2i64], [srl, SHR_U_v2i64]] in { @@ -683,49 +681,49 @@ multiclass SIMDBinaryIntSmall baseInst> { defm "" : SIMDBinary; - defm "" : SIMDBinary; + defm "" : SIMDBinary; } multiclass SIMDBinaryIntNoI64x2 baseInst> { defm "" : SIMDBinaryIntSmall; - defm "" : SIMDBinary; + defm "" : SIMDBinary; } multiclass SIMDBinaryInt baseInst> { defm "" : SIMDBinaryIntNoI64x2; - defm "" : SIMDBinary; + defm "" : SIMDBinary; } // Integer addition: add / add_saturate_s / add_saturate_u let isCommutable = 1 in { -defm ADD : SIMDBinaryInt; -defm ADD_SAT_S : SIMDBinaryIntSmall; -defm ADD_SAT_U : SIMDBinaryIntSmall; +defm ADD : SIMDBinaryInt; +defm ADD_SAT_S : SIMDBinaryIntSmall; +defm ADD_SAT_U : SIMDBinaryIntSmall; } // isCommutable = 1 // Integer subtraction: sub / sub_saturate_s / sub_saturate_u -defm SUB : SIMDBinaryInt; +defm SUB : SIMDBinaryInt; defm SUB_SAT_S : - SIMDBinaryIntSmall; + SIMDBinaryIntSmall; defm SUB_SAT_U : - SIMDBinaryIntSmall; + SIMDBinaryIntSmall; // Integer multiplication: mul let isCommutable = 1 in -defm MUL : SIMDBinaryIntNoI64x2; +defm MUL : SIMDBinaryIntNoI64x2; // Integer min_s / min_u / max_s / max_u let isCommutable = 1 in { -defm MIN_S : SIMDBinaryIntNoI64x2; -defm MIN_U : SIMDBinaryIntNoI64x2; -defm MAX_S : SIMDBinaryIntNoI64x2; -defm MAX_U : SIMDBinaryIntNoI64x2; +defm MIN_S : SIMDBinaryIntNoI64x2; +defm MIN_U : SIMDBinaryIntNoI64x2; +defm MAX_S : SIMDBinaryIntNoI64x2; +defm MAX_U : SIMDBinaryIntNoI64x2; } // isCommutable = 1 // Integer unsigned rounding average: avgr_u let isCommutable = 1 in { -defm AVGR_U : SIMDBinary; -defm AVGR_U : SIMDBinary; +defm AVGR_U : SIMDBinary; +defm AVGR_U : SIMDBinary; } def add_nuw : PatFrag<(ops node:$lhs, node:$rhs), @@ -747,7 +745,7 @@ defm DOT : SIMD_I<(outs V128:$dst), (ins V128:$lhs, V128:$rhs), (outs), (ins), [(set V128:$dst, (int_wasm_dot V128:$lhs, V128:$rhs))], "i32x4.dot_i16x8_s\t$dst, $lhs, $rhs", "i32x4.dot_i16x8_s", - 219>; + 180>; //===----------------------------------------------------------------------===// // Floating-point unary arithmetic @@ -755,17 +753,17 @@ multiclass SIMDUnaryFP baseInst> { defm "" : SIMDUnary; - defm "" : SIMDUnary; + defm "" : SIMDUnary; } // Absolute value: abs -defm ABS : SIMDUnaryFP; +defm ABS : SIMDUnaryFP; // Negation: neg -defm NEG : SIMDUnaryFP; +defm NEG : SIMDUnaryFP; // Square root: sqrt -defm SQRT : SIMDUnaryFP; +defm SQRT : SIMDUnaryFP; //===----------------------------------------------------------------------===// // Floating-point binary arithmetic @@ -773,28 +771,28 @@ multiclass SIMDBinaryFP baseInst> { defm "" : SIMDBinary; - defm "" : SIMDBinary; + defm "" : SIMDBinary; } // Addition: add let isCommutable = 1 in -defm ADD : SIMDBinaryFP; +defm ADD : SIMDBinaryFP; // Subtraction: sub -defm SUB : SIMDBinaryFP; +defm SUB : SIMDBinaryFP; // Multiplication: mul let isCommutable = 1 in -defm MUL : SIMDBinaryFP; +defm MUL : SIMDBinaryFP; // Division: div -defm DIV : SIMDBinaryFP; +defm DIV : SIMDBinaryFP; // NaN-propagating minimum: min -defm MIN : SIMDBinaryFP; +defm MIN : SIMDBinaryFP; // NaN-propagating maximum: max -defm MAX : SIMDBinaryFP; +defm MAX : SIMDBinaryFP; //===----------------------------------------------------------------------===// // Conversions @@ -808,23 +806,13 @@ name#"\t$dst, $vec", name, simdop>; } -// Integer to floating point: convert -defm "" : SIMDConvert; -defm "" : SIMDConvert; - -let Predicates = [HasUnimplementedSIMD128] in { -defm "" : SIMDConvert; -defm "" : SIMDConvert; -} - // Floating point to integer with saturation: trunc_sat -defm "" : SIMDConvert; -defm "" : SIMDConvert; +defm "" : SIMDConvert; +defm "" : SIMDConvert; -let Predicates = [HasUnimplementedSIMD128] in { -defm "" : SIMDConvert; -defm "" : SIMDConvert; -} +// Integer to floating point: convert +defm "" : SIMDConvert; +defm "" : SIMDConvert; // Widening operations multiclass SIMDWiden; } -defm "" : SIMDWiden; -defm "" : SIMDWiden; +defm "" : SIMDWiden; +defm "" : SIMDWiden; // Narrowing operations multiclass SIMDNarrow; } -defm "" : SIMDNarrow; -defm "" : SIMDNarrow; +defm "" : SIMDNarrow; +defm "" : SIMDNarrow; // Lower llvm.wasm.trunc.saturate.* to saturating instructions def : Pat<(v4i32 (int_wasm_trunc_saturate_signed (v4f32 V128:$src))), (fp_to_sint_v4i32_v4f32 (v4f32 V128:$src))>; def : Pat<(v4i32 (int_wasm_trunc_saturate_unsigned (v4f32 V128:$src))), (fp_to_uint_v4i32_v4f32 (v4f32 V128:$src))>; -def : Pat<(v2i64 (int_wasm_trunc_saturate_signed (v2f64 V128:$src))), - (fp_to_sint_v2i64_v2f64 (v2f64 V128:$src))>; -def : Pat<(v2i64 (int_wasm_trunc_saturate_unsigned (v2f64 V128:$src))), - (fp_to_uint_v2i64_v2f64 (v2f64 V128:$src))>; // Bitcasts are nops // Matching bitcast t1 to t1 causes strange errors, so avoid repeating types @@ -902,5 +886,5 @@ vec#".qfms\t$dst, $a, $b, $c", vec#".qfms", !add(baseInst, 1)>; } -defm "" : SIMDQFM; -defm "" : SIMDQFM; +defm "" : SIMDQFM; +defm "" : SIMDQFM; diff --git a/llvm/test/CodeGen/WebAssembly/simd-conversions.ll b/llvm/test/CodeGen/WebAssembly/simd-conversions.ll --- a/llvm/test/CodeGen/WebAssembly/simd-conversions.ll +++ b/llvm/test/CodeGen/WebAssembly/simd-conversions.ll @@ -31,8 +31,6 @@ ; NO-SIMD128-NOT: i64x2 ; SIMD128-VM-NOT: f64x2.convert_i64x2_s ; SIMD128-NEXT: .functype convert_s_v2f64 (v128) -> (v128){{$}} -; SIMD128-NEXT: f64x2.convert_i64x2_s $push[[R:[0-9]+]]=, $0 -; SIMD128-NEXT: return $pop[[R]] define <2 x double> @convert_s_v2f64(<2 x i64> %x) { %a = sitofp <2 x i64> %x to <2 x double> ret <2 x double> %a @@ -42,8 +40,6 @@ ; NO-SIMD128-NOT: i64x2 ; SIMD128-VM-NOT: f64x2.convert_i64x2_u ; SIMD128-NEXT: .functype convert_u_v2f64 (v128) -> (v128){{$}} -; SIMD128-NEXT: f64x2.convert_i64x2_u $push[[R:[0-9]+]]=, $0 -; SIMD128-NEXT: return $pop[[R]] define <2 x double> @convert_u_v2f64(<2 x i64> %x) { %a = uitofp <2 x i64> %x to <2 x double> ret <2 x double> %a @@ -73,8 +69,6 @@ ; NO-SIMD128-NOT: f64x2 ; SIMD128-VM-NOT: i64x2.trunc_sat_f64x2_s ; SIMD128-NEXT: .functype trunc_sat_s_v2i64 (v128) -> (v128){{$}} -; SIMD128-NEXT: i64x2.trunc_sat_f64x2_s $push[[R:[0-9]+]]=, $0 -; SIMD128-NEXT: return $pop[[R]] define <2 x i64> @trunc_sat_s_v2i64(<2 x double> %x) { %a = fptosi <2 x double> %x to <2 x i64> ret <2 x i64> %a @@ -84,8 +78,6 @@ ; NO-SIMD128-NOT: f64x2 ; SIMD128-VM-NOT: i64x2.trunc_sat_f64x2_u ; SIMD128-NEXT: .functype trunc_sat_u_v2i64 (v128) -> (v128){{$}} -; SIMD128-NEXT: i64x2.trunc_sat_f64x2_u $push[[R:[0-9]+]]=, $0 -; SIMD128-NEXT: return $pop[[R]] define <2 x i64> @trunc_sat_u_v2i64(<2 x double> %x) { %a = fptoui <2 x double> %x to <2 x i64> ret <2 x i64> %a diff --git a/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll b/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll --- a/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll +++ b/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll @@ -456,28 +456,6 @@ ret <2 x i64> %a } -; CHECK-LABEL: trunc_sat_s_v2i64: -; NO-SIMD128-NOT: f32x4 -; SIMD128-NEXT: .functype trunc_sat_s_v2i64 (v128) -> (v128){{$}} -; SIMD128-NEXT: i64x2.trunc_sat_f64x2_s $push[[R:[0-9]+]]=, $0 -; SIMD128-NEXT: return $pop[[R]] -declare <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double>) -define <2 x i64> @trunc_sat_s_v2i64(<2 x double> %x) { - %a = call <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double> %x) - ret <2 x i64> %a -} - -; CHECK-LABEL: trunc_sat_u_v2i64: -; NO-SIMD128-NOT: f32x4 -; SIMD128-NEXT: .functype trunc_sat_u_v2i64 (v128) -> (v128){{$}} -; SIMD128-NEXT: i64x2.trunc_sat_f64x2_u $push[[R:[0-9]+]]=, $0 -; SIMD128-NEXT: return $pop[[R]] -declare <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double>) -define <2 x i64> @trunc_sat_u_v2i64(<2 x double> %x) { - %a = call <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double> %x) - ret <2 x i64> %a -} - ; ============================================================================== ; 4 x f32 ; ============================================================================== diff --git a/llvm/test/MC/Disassembler/WebAssembly/wasm.txt b/llvm/test/MC/Disassembler/WebAssembly/wasm.txt --- a/llvm/test/MC/Disassembler/WebAssembly/wasm.txt +++ b/llvm/test/MC/Disassembler/WebAssembly/wasm.txt @@ -34,19 +34,19 @@ 0xFC 0x07 # CHECK: v128.const 50462976, 117835012, 185207048, 252579084 -0xFD 0x02 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F +0xFD 0x0C 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F # CHECK: v8x16.shuffle 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -0xFD 0x03 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F +0xFD 0x0D 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F # Check LEB128 encoding of SIMD instructions -# CHECK: i64x2.all_true -0xFD 0x86 0x01 +# CHECK: i16x8.all_true +0xFD 0x83 0x01 # Including non-canonical LEB128 encodings -# CHECK: i64x2.any_true -# CHECK-NOT: i64.div_u -0xFD 0x85 0x81 0x80 0x80 0x80 0x80 0x00 +# CHECK: i16x8.any_true +# CHECK-NOT: i16x8.neg +0xFD 0x82 0x81 0x80 0x80 0x80 0x80 0x00 # Check br_table, which has its own operand type. # CHECK: br_table {0, 1, 2} diff --git a/llvm/test/MC/WebAssembly/simd-encodings.s b/llvm/test/MC/WebAssembly/simd-encodings.s --- a/llvm/test/MC/WebAssembly/simd-encodings.s +++ b/llvm/test/MC/WebAssembly/simd-encodings.s @@ -6,17 +6,47 @@ # CHECK: v128.load 48 # encoding: [0xfd,0x00,0x04,0x30] v128.load 48 - # CHECK: v128.store 48 # encoding: [0xfd,0x01,0x04,0x30] + # CHECK: i16x8.load8x8_s 32 # encoding: [0xfd,0x01,0x03,0x20] + i16x8.load8x8_s 32 + + # CHECK: i16x8.load8x8_u 32 # encoding: [0xfd,0x02,0x03,0x20] + i16x8.load8x8_u 32 + + # CHECK: i32x4.load16x4_s 32 # encoding: [0xfd,0x03,0x03,0x20] + i32x4.load16x4_s 32 + + # CHECK: i32x4.load16x4_u 32 # encoding: [0xfd,0x04,0x03,0x20] + i32x4.load16x4_u 32 + + # CHECK: i64x2.load32x2_s 32 # encoding: [0xfd,0x05,0x03,0x20] + i64x2.load32x2_s 32 + + # CHECK: i64x2.load32x2_u 32 # encoding: [0xfd,0x06,0x03,0x20] + i64x2.load32x2_u 32 + + # CHECK: v8x16.load_splat 48 # encoding: [0xfd,0x07,0x00,0x30] + v8x16.load_splat 48 + + # CHECK: v16x8.load_splat 48 # encoding: [0xfd,0x08,0x01,0x30] + v16x8.load_splat 48 + + # CHECK: v32x4.load_splat 48 # encoding: [0xfd,0x09,0x02,0x30] + v32x4.load_splat 48 + + # CHECK: v64x2.load_splat 48 # encoding: [0xfd,0x0a,0x03,0x30] + v64x2.load_splat 48 + + # CHECK: v128.store 48 # encoding: [0xfd,0x0b,0x04,0x30] v128.store 48 # CHECK: v128.const 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 - # CHECK-SAME: # encoding: [0xfd,0x02, + # CHECK-SAME: # encoding: [0xfd,0x0c, # CHECK-SAME: 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, # CHECK-SAME: 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f] v128.const 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 # CHECK: v128.const 256, 770, 1284, 1798, 2312, 2826, 3340, 3854 - # CHECK-SAME: # encoding: [0xfd,0x02, + # CHECK-SAME: # encoding: [0xfd,0x0c, # CHECK-SAME: 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, # CHECK-SAME: 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f] v128.const 256, 770, 1284, 1798, 2312, 2826, 3340, 3854 @@ -25,577 +55,535 @@ # CHECK: v128.const 0x1.0402p-121, 0x1.0c0a08p-113, # CHECK-SAME: 0x1.14121p-105, 0x1.1c1a18p-97 - # CHECK-SAME: # encoding: [0xfd,0x02, + # CHECK-SAME: # encoding: [0xfd,0x0c, # CHECK-SAME: 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, # CHECK-SAME: 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f] v128.const 0x1.0402p-121, 0x1.0c0a08p-113, 0x1.14121p-105, 0x1.1c1a18p-97 # CHECK: v128.const 0x1.60504030201p-911, 0x1.e0d0c0b0a0908p-783 - # CHECK-SAME: # encoding: [0xfd,0x02, + # CHECK-SAME: # encoding: [0xfd,0x0c, # CHECK-SAME: 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, # CHECK-SAME: 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f] v128.const 0x1.60504030201p-911, 0x1.e0d0c0b0a0908p-783 # CHECK: v8x16.shuffle 0, 17, 2, 19, 4, 21, 6, 23, # CHECK-SAME: 8, 25, 10, 27, 12, 29, 14, 31 - # CHECK-SAME: # encoding: [0xfd,0x03, + # CHECK-SAME: # encoding: [0xfd,0x0d, # CHECK-SAME: 0x00,0x11,0x02,0x13,0x04,0x15,0x06,0x17, # CHECK-SAME: 0x08,0x19,0x0a,0x1b,0x0c,0x1d,0x0e,0x1f] v8x16.shuffle 0, 17, 2, 19, 4, 21, 6, 23, 8, 25, 10, 27, 12, 29, 14, 31 - # CHECK: i8x16.splat # encoding: [0xfd,0x04] + # CHECK: v8x16.swizzle # encoding: [0xfd,0x0e] + v8x16.swizzle + + # CHECK: i8x16.splat # encoding: [0xfd,0x0f] i8x16.splat - # CHECK: i8x16.extract_lane_s 15 # encoding: [0xfd,0x05,0x0f] + # CHECK: i16x8.splat # encoding: [0xfd,0x10] + i16x8.splat + + # CHECK: i32x4.splat # encoding: [0xfd,0x11] + i32x4.splat + + # CHECK: i64x2.splat # encoding: [0xfd,0x12] + i64x2.splat + + # CHECK: f32x4.splat # encoding: [0xfd,0x13] + f32x4.splat + + # CHECK: f64x2.splat # encoding: [0xfd,0x14] + f64x2.splat + + # CHECK: i8x16.extract_lane_s 15 # encoding: [0xfd,0x15,0x0f] i8x16.extract_lane_s 15 - # CHECK: i8x16.extract_lane_u 15 # encoding: [0xfd,0x06,0x0f] + # CHECK: i8x16.extract_lane_u 15 # encoding: [0xfd,0x16,0x0f] i8x16.extract_lane_u 15 - # CHECK: i8x16.replace_lane 15 # encoding: [0xfd,0x07,0x0f] + # CHECK: i8x16.replace_lane 15 # encoding: [0xfd,0x17,0x0f] i8x16.replace_lane 15 - # CHECK: i16x8.splat # encoding: [0xfd,0x08] - i16x8.splat - - # CHECK: i16x8.extract_lane_s 7 # encoding: [0xfd,0x09,0x07] + # CHECK: i16x8.extract_lane_s 7 # encoding: [0xfd,0x18,0x07] i16x8.extract_lane_s 7 - # CHECK: i16x8.extract_lane_u 7 # encoding: [0xfd,0x0a,0x07] + # CHECK: i16x8.extract_lane_u 7 # encoding: [0xfd,0x19,0x07] i16x8.extract_lane_u 7 - # CHECK: i16x8.replace_lane 7 # encoding: [0xfd,0x0b,0x07] + # CHECK: i16x8.replace_lane 7 # encoding: [0xfd,0x1a,0x07] i16x8.replace_lane 7 - # CHECK: i32x4.splat # encoding: [0xfd,0x0c] - i32x4.splat - - # CHECK: i32x4.extract_lane 3 # encoding: [0xfd,0x0d,0x03] + # CHECK: i32x4.extract_lane 3 # encoding: [0xfd,0x1b,0x03] i32x4.extract_lane 3 - # CHECK: i32x4.replace_lane 3 # encoding: [0xfd,0x0e,0x03] + # CHECK: i32x4.replace_lane 3 # encoding: [0xfd,0x1c,0x03] i32x4.replace_lane 3 - # CHECK: i64x2.splat # encoding: [0xfd,0x0f] - i64x2.splat - - # CHECK: i64x2.extract_lane 1 # encoding: [0xfd,0x10,0x01] + # CHECK: i64x2.extract_lane 1 # encoding: [0xfd,0x1d,0x01] i64x2.extract_lane 1 - # CHECK: i64x2.replace_lane 1 # encoding: [0xfd,0x11,0x01] + # CHECK: i64x2.replace_lane 1 # encoding: [0xfd,0x1e,0x01] i64x2.replace_lane 1 - # CHECK: f32x4.splat # encoding: [0xfd,0x12] - f32x4.splat - - # CHECK: f32x4.extract_lane 3 # encoding: [0xfd,0x13,0x03] + # CHECK: f32x4.extract_lane 3 # encoding: [0xfd,0x1f,0x03] f32x4.extract_lane 3 - # CHECK: f32x4.replace_lane 3 # encoding: [0xfd,0x14,0x03] + # CHECK: f32x4.replace_lane 3 # encoding: [0xfd,0x20,0x03] f32x4.replace_lane 3 - # CHECK: f64x2.splat # encoding: [0xfd,0x15] - f64x2.splat - - # CHECK: f64x2.extract_lane 1 # encoding: [0xfd,0x16,0x01] + # CHECK: f64x2.extract_lane 1 # encoding: [0xfd,0x21,0x01] f64x2.extract_lane 1 - # CHECK: f64x2.replace_lane 1 # encoding: [0xfd,0x17,0x01] + # CHECK: f64x2.replace_lane 1 # encoding: [0xfd,0x22,0x01] f64x2.replace_lane 1 - # CHECK: i8x16.eq # encoding: [0xfd,0x18] + # CHECK: i8x16.eq # encoding: [0xfd,0x23] i8x16.eq - # CHECK: i8x16.ne # encoding: [0xfd,0x19] + # CHECK: i8x16.ne # encoding: [0xfd,0x24] i8x16.ne - # CHECK: i8x16.lt_s # encoding: [0xfd,0x1a] + # CHECK: i8x16.lt_s # encoding: [0xfd,0x25] i8x16.lt_s - # CHECK: i8x16.lt_u # encoding: [0xfd,0x1b] + # CHECK: i8x16.lt_u # encoding: [0xfd,0x26] i8x16.lt_u - # CHECK: i8x16.gt_s # encoding: [0xfd,0x1c] + # CHECK: i8x16.gt_s # encoding: [0xfd,0x27] i8x16.gt_s - # CHECK: i8x16.gt_u # encoding: [0xfd,0x1d] + # CHECK: i8x16.gt_u # encoding: [0xfd,0x28] i8x16.gt_u - # CHECK: i8x16.le_s # encoding: [0xfd,0x1e] + # CHECK: i8x16.le_s # encoding: [0xfd,0x29] i8x16.le_s - # CHECK: i8x16.le_u # encoding: [0xfd,0x1f] + # CHECK: i8x16.le_u # encoding: [0xfd,0x2a] i8x16.le_u - # CHECK: i8x16.ge_s # encoding: [0xfd,0x20] + # CHECK: i8x16.ge_s # encoding: [0xfd,0x2b] i8x16.ge_s - # CHECK: i8x16.ge_u # encoding: [0xfd,0x21] + # CHECK: i8x16.ge_u # encoding: [0xfd,0x2c] i8x16.ge_u - # CHECK: i16x8.eq # encoding: [0xfd,0x22] + # CHECK: i16x8.eq # encoding: [0xfd,0x2d] i16x8.eq - # CHECK: i16x8.ne # encoding: [0xfd,0x23] + # CHECK: i16x8.ne # encoding: [0xfd,0x2e] i16x8.ne - # CHECK: i16x8.lt_s # encoding: [0xfd,0x24] + # CHECK: i16x8.lt_s # encoding: [0xfd,0x2f] i16x8.lt_s - # CHECK: i16x8.lt_u # encoding: [0xfd,0x25] + # CHECK: i16x8.lt_u # encoding: [0xfd,0x30] i16x8.lt_u - # CHECK: i16x8.gt_s # encoding: [0xfd,0x26] + # CHECK: i16x8.gt_s # encoding: [0xfd,0x31] i16x8.gt_s - # CHECK: i16x8.gt_u # encoding: [0xfd,0x27] + # CHECK: i16x8.gt_u # encoding: [0xfd,0x32] i16x8.gt_u - # CHECK: i16x8.le_s # encoding: [0xfd,0x28] + # CHECK: i16x8.le_s # encoding: [0xfd,0x33] i16x8.le_s - # CHECK: i16x8.le_u # encoding: [0xfd,0x29] + # CHECK: i16x8.le_u # encoding: [0xfd,0x34] i16x8.le_u - # CHECK: i16x8.ge_s # encoding: [0xfd,0x2a] + # CHECK: i16x8.ge_s # encoding: [0xfd,0x35] i16x8.ge_s - # CHECK: i16x8.ge_u # encoding: [0xfd,0x2b] + # CHECK: i16x8.ge_u # encoding: [0xfd,0x36] i16x8.ge_u - # CHECK: i32x4.eq # encoding: [0xfd,0x2c] + # CHECK: i32x4.eq # encoding: [0xfd,0x37] i32x4.eq - # CHECK: i32x4.ne # encoding: [0xfd,0x2d] + # CHECK: i32x4.ne # encoding: [0xfd,0x38] i32x4.ne - # CHECK: i32x4.lt_s # encoding: [0xfd,0x2e] + # CHECK: i32x4.lt_s # encoding: [0xfd,0x39] i32x4.lt_s - # CHECK: i32x4.lt_u # encoding: [0xfd,0x2f] + # CHECK: i32x4.lt_u # encoding: [0xfd,0x3a] i32x4.lt_u - # CHECK: i32x4.gt_s # encoding: [0xfd,0x30] + # CHECK: i32x4.gt_s # encoding: [0xfd,0x3b] i32x4.gt_s - # CHECK: i32x4.gt_u # encoding: [0xfd,0x31] + # CHECK: i32x4.gt_u # encoding: [0xfd,0x3c] i32x4.gt_u - # CHECK: i32x4.le_s # encoding: [0xfd,0x32] + # CHECK: i32x4.le_s # encoding: [0xfd,0x3d] i32x4.le_s - # CHECK: i32x4.le_u # encoding: [0xfd,0x33] + # CHECK: i32x4.le_u # encoding: [0xfd,0x3e] i32x4.le_u - # CHECK: i32x4.ge_s # encoding: [0xfd,0x34] + # CHECK: i32x4.ge_s # encoding: [0xfd,0x3f] i32x4.ge_s - # CHECK: i32x4.ge_u # encoding: [0xfd,0x35] + # CHECK: i32x4.ge_u # encoding: [0xfd,0x40] i32x4.ge_u - # CHECK: f32x4.eq # encoding: [0xfd,0x40] + # CHECK: f32x4.eq # encoding: [0xfd,0x41] f32x4.eq - # CHECK: f32x4.ne # encoding: [0xfd,0x41] + # CHECK: f32x4.ne # encoding: [0xfd,0x42] f32x4.ne - # CHECK: f32x4.lt # encoding: [0xfd,0x42] + # CHECK: f32x4.lt # encoding: [0xfd,0x43] f32x4.lt - # CHECK: f32x4.gt # encoding: [0xfd,0x43] + # CHECK: f32x4.gt # encoding: [0xfd,0x44] f32x4.gt - # CHECK: f32x4.le # encoding: [0xfd,0x44] + # CHECK: f32x4.le # encoding: [0xfd,0x45] f32x4.le - # CHECK: f32x4.ge # encoding: [0xfd,0x45] + # CHECK: f32x4.ge # encoding: [0xfd,0x46] f32x4.ge - # CHECK: f64x2.eq # encoding: [0xfd,0x46] + # CHECK: f64x2.eq # encoding: [0xfd,0x47] f64x2.eq - # CHECK: f64x2.ne # encoding: [0xfd,0x47] + # CHECK: f64x2.ne # encoding: [0xfd,0x48] f64x2.ne - # CHECK: f64x2.lt # encoding: [0xfd,0x48] + # CHECK: f64x2.lt # encoding: [0xfd,0x49] f64x2.lt - # CHECK: f64x2.gt # encoding: [0xfd,0x49] + # CHECK: f64x2.gt # encoding: [0xfd,0x4a] f64x2.gt - # CHECK: f64x2.le # encoding: [0xfd,0x4a] + # CHECK: f64x2.le # encoding: [0xfd,0x4b] f64x2.le - # CHECK: f64x2.ge # encoding: [0xfd,0x4b] + # CHECK: f64x2.ge # encoding: [0xfd,0x4c] f64x2.ge - # CHECK: v128.not # encoding: [0xfd,0x4c] + # CHECK: v128.not # encoding: [0xfd,0x4d] v128.not - # CHECK: v128.and # encoding: [0xfd,0x4d] + # CHECK: v128.and # encoding: [0xfd,0x4e] v128.and - # CHECK: v128.or # encoding: [0xfd,0x4e] + # CHECK: v128.andnot # encoding: [0xfd,0x4f] + v128.andnot + + # CHECK: v128.or # encoding: [0xfd,0x50] v128.or - # CHECK: v128.xor # encoding: [0xfd,0x4f] + # CHECK: v128.xor # encoding: [0xfd,0x51] v128.xor - # CHECK: v128.bitselect # encoding: [0xfd,0x50] + # CHECK: v128.bitselect # encoding: [0xfd,0x52] v128.bitselect - # CHECK: i8x16.neg # encoding: [0xfd,0x51] + # CHECK: i8x16.abs # encoding: [0xfd,0x60] + i8x16.abs + + # CHECK: i8x16.neg # encoding: [0xfd,0x61] i8x16.neg - # CHECK: i8x16.any_true # encoding: [0xfd,0x52] + # CHECK: i8x16.any_true # encoding: [0xfd,0x62] i8x16.any_true - # CHECK: i8x16.all_true # encoding: [0xfd,0x53] + # CHECK: i8x16.all_true # encoding: [0xfd,0x63] i8x16.all_true - # CHECK: i8x16.shl # encoding: [0xfd,0x54] + # CHECK: i8x16.bitmask # encoding: [0xfd,0x64] + i8x16.bitmask + + # CHECK: i8x16.narrow_i16x8_s # encoding: [0xfd,0x65] + i8x16.narrow_i16x8_s + + # CHECK: i8x16.narrow_i16x8_u # encoding: [0xfd,0x66] + i8x16.narrow_i16x8_u + + # CHECK: i8x16.shl # encoding: [0xfd,0x6b] i8x16.shl - # CHECK: i8x16.shr_s # encoding: [0xfd,0x55] + # CHECK: i8x16.shr_s # encoding: [0xfd,0x6c] i8x16.shr_s - # CHECK: i8x16.shr_u # encoding: [0xfd,0x56] + # CHECK: i8x16.shr_u # encoding: [0xfd,0x6d] i8x16.shr_u - # CHECK: i8x16.add # encoding: [0xfd,0x57] + # CHECK: i8x16.add # encoding: [0xfd,0x6e] i8x16.add - # CHECK: i8x16.add_saturate_s # encoding: [0xfd,0x58] + # CHECK: i8x16.add_saturate_s # encoding: [0xfd,0x6f] i8x16.add_saturate_s - # CHECK: i8x16.add_saturate_u # encoding: [0xfd,0x59] + # CHECK: i8x16.add_saturate_u # encoding: [0xfd,0x70] i8x16.add_saturate_u - # CHECK: i8x16.sub # encoding: [0xfd,0x5a] + # CHECK: i8x16.sub # encoding: [0xfd,0x71] i8x16.sub - # CHECK: i8x16.sub_saturate_s # encoding: [0xfd,0x5b] + # CHECK: i8x16.sub_saturate_s # encoding: [0xfd,0x72] i8x16.sub_saturate_s - # CHECK: i8x16.sub_saturate_u # encoding: [0xfd,0x5c] + # CHECK: i8x16.sub_saturate_u # encoding: [0xfd,0x73] i8x16.sub_saturate_u - # CHECK: i8x16.mul # encoding: [0xfd,0x5d] + # CHECK: i8x16.mul # encoding: [0xfd,0x75] i8x16.mul - # CHECK: i8x16.min_s # encoding: [0xfd,0x5e] + # CHECK: i8x16.min_s # encoding: [0xfd,0x76] i8x16.min_s - # CHECK: i8x16.min_u # encoding: [0xfd,0x5f] + # CHECK: i8x16.min_u # encoding: [0xfd,0x77] i8x16.min_u - # CHECK: i8x16.max_s # encoding: [0xfd,0x60] + # CHECK: i8x16.max_s # encoding: [0xfd,0x78] i8x16.max_s - # CHECK: i8x16.max_u # encoding: [0xfd,0x61] + # CHECK: i8x16.max_u # encoding: [0xfd,0x79] i8x16.max_u - # CHECK: i16x8.neg # encoding: [0xfd,0x62] + # CHECK: i8x16.avgr_u # encoding: [0xfd,0x7b] + i8x16.avgr_u + + # CHECK: i16x8.abs # encoding: [0xfd,0x80,0x01] + i16x8.abs + + # CHECK: i16x8.neg # encoding: [0xfd,0x81,0x01] i16x8.neg - # CHECK: i16x8.any_true # encoding: [0xfd,0x63] + # CHECK: i16x8.any_true # encoding: [0xfd,0x82,0x01] i16x8.any_true - # CHECK: i16x8.all_true # encoding: [0xfd,0x64] + # CHECK: i16x8.all_true # encoding: [0xfd,0x83,0x01] i16x8.all_true - # CHECK: i16x8.shl # encoding: [0xfd,0x65] + # CHECK: i16x8.bitmask # encoding: [0xfd,0x84,0x01] + i16x8.bitmask + + # CHECK: i16x8.narrow_i32x4_s # encoding: [0xfd,0x85,0x01] + i16x8.narrow_i32x4_s + + # CHECK: i16x8.narrow_i32x4_u # encoding: [0xfd,0x86,0x01] + i16x8.narrow_i32x4_u + + # CHECK: i16x8.widen_low_i8x16_s # encoding: [0xfd,0x87,0x01] + i16x8.widen_low_i8x16_s + + # CHECK: i16x8.widen_high_i8x16_s # encoding: [0xfd,0x88,0x01] + i16x8.widen_high_i8x16_s + + # CHECK: i16x8.widen_low_i8x16_u # encoding: [0xfd,0x89,0x01] + i16x8.widen_low_i8x16_u + + # CHECK: i16x8.widen_high_i8x16_u # encoding: [0xfd,0x8a,0x01] + i16x8.widen_high_i8x16_u + + # CHECK: i16x8.shl # encoding: [0xfd,0x8b,0x01] i16x8.shl - # CHECK: i16x8.shr_s # encoding: [0xfd,0x66] + # CHECK: i16x8.shr_s # encoding: [0xfd,0x8c,0x01] i16x8.shr_s - # CHECK: i16x8.shr_u # encoding: [0xfd,0x67] + # CHECK: i16x8.shr_u # encoding: [0xfd,0x8d,0x01] i16x8.shr_u - # CHECK: i16x8.add # encoding: [0xfd,0x68] + # CHECK: i16x8.add # encoding: [0xfd,0x8e,0x01] i16x8.add - # CHECK: i16x8.add_saturate_s # encoding: [0xfd,0x69] + # CHECK: i16x8.add_saturate_s # encoding: [0xfd,0x8f,0x01] i16x8.add_saturate_s - # CHECK: i16x8.add_saturate_u # encoding: [0xfd,0x6a] + # CHECK: i16x8.add_saturate_u # encoding: [0xfd,0x90,0x01] i16x8.add_saturate_u - # CHECK: i16x8.sub # encoding: [0xfd,0x6b] + # CHECK: i16x8.sub # encoding: [0xfd,0x91,0x01] i16x8.sub - # CHECK: i16x8.sub_saturate_s # encoding: [0xfd,0x6c] + # CHECK: i16x8.sub_saturate_s # encoding: [0xfd,0x92,0x01] i16x8.sub_saturate_s - # CHECK: i16x8.sub_saturate_u # encoding: [0xfd,0x6d] + # CHECK: i16x8.sub_saturate_u # encoding: [0xfd,0x93,0x01] i16x8.sub_saturate_u - # CHECK: i16x8.mul # encoding: [0xfd,0x6e] + # CHECK: i16x8.mul # encoding: [0xfd,0x95,0x01] i16x8.mul - # CHECK: i16x8.min_s # encoding: [0xfd,0x6f] + # CHECK: i16x8.min_s # encoding: [0xfd,0x96,0x01] i16x8.min_s - # CHECK: i16x8.min_u # encoding: [0xfd,0x70] + # CHECK: i16x8.min_u # encoding: [0xfd,0x97,0x01] i16x8.min_u - # CHECK: i16x8.max_s # encoding: [0xfd,0x71] + # CHECK: i16x8.max_s # encoding: [0xfd,0x98,0x01] i16x8.max_s - # CHECK: i16x8.max_u # encoding: [0xfd,0x72] + # CHECK: i16x8.max_u # encoding: [0xfd,0x99,0x01] i16x8.max_u - # CHECK: i32x4.neg # encoding: [0xfd,0x73] + # CHECK: i16x8.avgr_u # encoding: [0xfd,0x9b,0x01] + i16x8.avgr_u + + # CHECK: i32x4.abs # encoding: [0xfd,0xa0,0x01] + i32x4.abs + + # CHECK: i32x4.neg # encoding: [0xfd,0xa1,0x01] i32x4.neg - # CHECK: i32x4.any_true # encoding: [0xfd,0x74] + # CHECK: i32x4.any_true # encoding: [0xfd,0xa2,0x01] i32x4.any_true - # CHECK: i32x4.all_true # encoding: [0xfd,0x75] + # CHECK: i32x4.all_true # encoding: [0xfd,0xa3,0x01] i32x4.all_true - # CHECK: i32x4.shl # encoding: [0xfd,0x76] + # CHECK: i32x4.bitmask # encoding: [0xfd,0xa4,0x01] + i32x4.bitmask + + # CHECK: i32x4.widen_low_i16x8_s # encoding: [0xfd,0xa7,0x01] + i32x4.widen_low_i16x8_s + + # CHECK: i32x4.widen_high_i16x8_s # encoding: [0xfd,0xa8,0x01] + i32x4.widen_high_i16x8_s + + # CHECK: i32x4.widen_low_i16x8_u # encoding: [0xfd,0xa9,0x01] + i32x4.widen_low_i16x8_u + + # CHECK: i32x4.widen_high_i16x8_u # encoding: [0xfd,0xaa,0x01] + i32x4.widen_high_i16x8_u + + # CHECK: i32x4.shl # encoding: [0xfd,0xab,0x01] i32x4.shl - # CHECK: i32x4.shr_s # encoding: [0xfd,0x77] + # CHECK: i32x4.shr_s # encoding: [0xfd,0xac,0x01] i32x4.shr_s - # CHECK: i32x4.shr_u # encoding: [0xfd,0x78] + # CHECK: i32x4.shr_u # encoding: [0xfd,0xad,0x01] i32x4.shr_u - # CHECK: i32x4.add # encoding: [0xfd,0x79] + # CHECK: i32x4.add # encoding: [0xfd,0xae,0x01] i32x4.add - # CHECK: i32x4.sub # encoding: [0xfd,0x7c] + # CHECK: i32x4.sub # encoding: [0xfd,0xb1,0x01] i32x4.sub - # CHECK: i32x4.mul # encoding: [0xfd,0x7f] + # CHECK: i32x4.dot_i16x8_s # encoding: [0xfd,0xb4,0x01] + i32x4.dot_i16x8_s + + # CHECK: i32x4.mul # encoding: [0xfd,0xb5,0x01] i32x4.mul - # CHECK: i32x4.min_s # encoding: [0xfd,0x80,0x01] + # CHECK: i32x4.min_s # encoding: [0xfd,0xb6,0x01] i32x4.min_s - # CHECK: i32x4.min_u # encoding: [0xfd,0x81,0x01] + # CHECK: i32x4.min_u # encoding: [0xfd,0xb7,0x01] i32x4.min_u - # CHECK: i32x4.max_s # encoding: [0xfd,0x82,0x01] + # CHECK: i32x4.max_s # encoding: [0xfd,0xb8,0x01] i32x4.max_s - # CHECK: i32x4.max_u # encoding: [0xfd,0x83,0x01] + # CHECK: i32x4.max_u # encoding: [0xfd,0xb9,0x01] i32x4.max_u - # CHECK: i64x2.neg # encoding: [0xfd,0x84,0x01] + # CHECK: i64x2.neg # encoding: [0xfd,0xc1,0x01] i64x2.neg - # CHECK: i64x2.any_true # encoding: [0xfd,0x85,0x01] + # CHECK: i64x2.any_true # encoding: [0xfd,0xc2,0x01] i64x2.any_true - # CHECK: i64x2.all_true # encoding: [0xfd,0x86,0x01] + # CHECK: i64x2.all_true # encoding: [0xfd,0xc3,0x01] i64x2.all_true - # CHECK: i64x2.shl # encoding: [0xfd,0x87,0x01] + # CHECK: i64x2.shl # encoding: [0xfd,0xcb,0x01] i64x2.shl - # CHECK: i64x2.shr_s # encoding: [0xfd,0x88,0x01] + # CHECK: i64x2.shr_s # encoding: [0xfd,0xcc,0x01] i64x2.shr_s - # CHECK: i64x2.shr_u # encoding: [0xfd,0x89,0x01] + # CHECK: i64x2.shr_u # encoding: [0xfd,0xcd,0x01] i64x2.shr_u - # CHECK: i64x2.add # encoding: [0xfd,0x8a,0x01] + # CHECK: i64x2.add # encoding: [0xfd,0xce,0x01] i64x2.add - # CHECK: i64x2.sub # encoding: [0xfd,0x8d,0x01] + # CHECK: i64x2.sub # encoding: [0xfd,0xd1,0x01] i64x2.sub - # CHECK: f32x4.abs # encoding: [0xfd,0x95,0x01] + # CHECK: f32x4.abs # encoding: [0xfd,0xe0,0x01] f32x4.abs - # CHECK: f32x4.neg # encoding: [0xfd,0x96,0x01] + # CHECK: f32x4.neg # encoding: [0xfd,0xe1,0x01] f32x4.neg - # CHECK: f32x4.sqrt # encoding: [0xfd,0x97,0x01] + # CHECK: f32x4.sqrt # encoding: [0xfd,0xe3,0x01] f32x4.sqrt - # CHECK: f32x4.qfma # encoding: [0xfd,0x98,0x01] - f32x4.qfma - - # CHECK: f32x4.qfms # encoding: [0xfd,0x99,0x01] - f32x4.qfms - - # CHECK: f32x4.add # encoding: [0xfd,0x9a,0x01] + # CHECK: f32x4.add # encoding: [0xfd,0xe4,0x01] f32x4.add - # CHECK: f32x4.sub # encoding: [0xfd,0x9b,0x01] + # CHECK: f32x4.sub # encoding: [0xfd,0xe5,0x01] f32x4.sub - # CHECK: f32x4.mul # encoding: [0xfd,0x9c,0x01] + # CHECK: f32x4.mul # encoding: [0xfd,0xe6,0x01] f32x4.mul - # CHECK: f32x4.div # encoding: [0xfd,0x9d,0x01] + # CHECK: f32x4.div # encoding: [0xfd,0xe7,0x01] f32x4.div - # CHECK: f32x4.min # encoding: [0xfd,0x9e,0x01] + # CHECK: f32x4.min # encoding: [0xfd,0xe8,0x01] f32x4.min - # CHECK: f32x4.max # encoding: [0xfd,0x9f,0x01] + # CHECK: f32x4.max # encoding: [0xfd,0xe9,0x01] f32x4.max - # CHECK: f64x2.abs # encoding: [0xfd,0xa0,0x01] + # CHECK: f64x2.abs # encoding: [0xfd,0xec,0x01] f64x2.abs - # CHECK: f64x2.neg # encoding: [0xfd,0xa1,0x01] + # CHECK: f64x2.neg # encoding: [0xfd,0xed,0x01] f64x2.neg - # CHECK: f64x2.sqrt # encoding: [0xfd,0xa2,0x01] + # CHECK: f64x2.sqrt # encoding: [0xfd,0xef,0x01] f64x2.sqrt - # CHECK: f64x2.qfma # encoding: [0xfd,0xa3,0x01] - f64x2.qfma - - # CHECK: f64x2.qfms # encoding: [0xfd,0xa4,0x01] - f64x2.qfms - - # CHECK: f64x2.add # encoding: [0xfd,0xa5,0x01] + # CHECK: f64x2.add # encoding: [0xfd,0xf0,0x01] f64x2.add - # CHECK: f64x2.sub # encoding: [0xfd,0xa6,0x01] + # CHECK: f64x2.sub # encoding: [0xfd,0xf1,0x01] f64x2.sub - # CHECK: f64x2.mul # encoding: [0xfd,0xa7,0x01] + # CHECK: f64x2.mul # encoding: [0xfd,0xf2,0x01] f64x2.mul - # CHECK: f64x2.div # encoding: [0xfd,0xa8,0x01] + # CHECK: f64x2.div # encoding: [0xfd,0xf3,0x01] f64x2.div - # CHECK: f64x2.min # encoding: [0xfd,0xa9,0x01] + # CHECK: f64x2.min # encoding: [0xfd,0xf4,0x01] f64x2.min - # CHECK: f64x2.max # encoding: [0xfd,0xaa,0x01] + # CHECK: f64x2.max # encoding: [0xfd,0xf5,0x01] f64x2.max - # CHECK: i32x4.trunc_sat_f32x4_s # encoding: [0xfd,0xab,0x01] + # CHECK: i32x4.trunc_sat_f32x4_s # encoding: [0xfd,0xf8,0x01] i32x4.trunc_sat_f32x4_s - # CHECK: i32x4.trunc_sat_f32x4_u # encoding: [0xfd,0xac,0x01] + # CHECK: i32x4.trunc_sat_f32x4_u # encoding: [0xfd,0xf9,0x01] i32x4.trunc_sat_f32x4_u - # CHECK: i64x2.trunc_sat_f64x2_s # encoding: [0xfd,0xad,0x01] - i64x2.trunc_sat_f64x2_s - - # CHECK: i64x2.trunc_sat_f64x2_u # encoding: [0xfd,0xae,0x01] - i64x2.trunc_sat_f64x2_u - - # CHECK: f32x4.convert_i32x4_s # encoding: [0xfd,0xaf,0x01] + # CHECK: f32x4.convert_i32x4_s # encoding: [0xfd,0xfa,0x01] f32x4.convert_i32x4_s - # CHECK: f32x4.convert_i32x4_u # encoding: [0xfd,0xb0,0x01] + # CHECK: f32x4.convert_i32x4_u # encoding: [0xfd,0xfb,0x01] f32x4.convert_i32x4_u - # CHECK: f64x2.convert_i64x2_s # encoding: [0xfd,0xb1,0x01] - f64x2.convert_i64x2_s - - # CHECK: f64x2.convert_i64x2_u # encoding: [0xfd,0xb2,0x01] - f64x2.convert_i64x2_u - - # CHECK: v8x16.swizzle # encoding: [0xfd,0xc0,0x01] - v8x16.swizzle - - # CHECK: v8x16.load_splat 48 # encoding: [0xfd,0xc2,0x01,0x00,0x30] - v8x16.load_splat 48 - - # CHECK: v16x8.load_splat 48 # encoding: [0xfd,0xc3,0x01,0x01,0x30] - v16x8.load_splat 48 - - # CHECK: v32x4.load_splat 48 # encoding: [0xfd,0xc4,0x01,0x02,0x30] - v32x4.load_splat 48 - - # CHECK: v64x2.load_splat 48 # encoding: [0xfd,0xc5,0x01,0x03,0x30] - v64x2.load_splat 48 - - # CHECK: i8x16.narrow_i16x8_s # encoding: [0xfd,0xc6,0x01] - i8x16.narrow_i16x8_s - - # CHECK: i8x16.narrow_i16x8_u # encoding: [0xfd,0xc7,0x01] - i8x16.narrow_i16x8_u - - # CHECK: i16x8.narrow_i32x4_s # encoding: [0xfd,0xc8,0x01] - i16x8.narrow_i32x4_s - - # CHECK: i16x8.narrow_i32x4_u # encoding: [0xfd,0xc9,0x01] - i16x8.narrow_i32x4_u - - # CHECK: i16x8.widen_low_i8x16_s # encoding: [0xfd,0xca,0x01] - i16x8.widen_low_i8x16_s - - # CHECK: i16x8.widen_high_i8x16_s # encoding: [0xfd,0xcb,0x01] - i16x8.widen_high_i8x16_s - - # CHECK: i16x8.widen_low_i8x16_u # encoding: [0xfd,0xcc,0x01] - i16x8.widen_low_i8x16_u - - # CHECK: i16x8.widen_high_i8x16_u # encoding: [0xfd,0xcd,0x01] - i16x8.widen_high_i8x16_u - - # CHECK: i32x4.widen_low_i16x8_s # encoding: [0xfd,0xce,0x01] - i32x4.widen_low_i16x8_s - - # CHECK: i32x4.widen_high_i16x8_s # encoding: [0xfd,0xcf,0x01] - i32x4.widen_high_i16x8_s - - # CHECK: i32x4.widen_low_i16x8_u # encoding: [0xfd,0xd0,0x01] - i32x4.widen_low_i16x8_u - - # CHECK: i32x4.widen_high_i16x8_u # encoding: [0xfd,0xd1,0x01] - i32x4.widen_high_i16x8_u - - # CHECK: i16x8.load8x8_s 32 # encoding: [0xfd,0xd2,0x01,0x03,0x20] - i16x8.load8x8_s 32 - - # CHECK: i16x8.load8x8_u 32 # encoding: [0xfd,0xd3,0x01,0x03,0x20] - i16x8.load8x8_u 32 - - # CHECK: i32x4.load16x4_s 32 # encoding: [0xfd,0xd4,0x01,0x03,0x20] - i32x4.load16x4_s 32 - - # CHECK: i32x4.load16x4_u 32 # encoding: [0xfd,0xd5,0x01,0x03,0x20] - i32x4.load16x4_u 32 - - # CHECK: i64x2.load32x2_s 32 # encoding: [0xfd,0xd6,0x01,0x03,0x20] - i64x2.load32x2_s 32 - - # CHECK: i64x2.load32x2_u 32 # encoding: [0xfd,0xd7,0x01,0x03,0x20] - i64x2.load32x2_u 32 - - # CHECK: v128.andnot # encoding: [0xfd,0xd8,0x01] - v128.andnot - - # CHECK: i8x16.avgr_u # encoding: [0xfd,0xd9,0x01] - i8x16.avgr_u - - # CHECK: i16x8.avgr_u # encoding: [0xfd,0xda,0x01] - i16x8.avgr_u - - # CHECK: i32x4.dot_i16x8_s # encoding: [0xfd,0xdb,0x01] - i32x4.dot_i16x8_s - - # CHECK: i8x16.abs # encoding: [0xfd,0xe1,0x01] - i8x16.abs - - # CHECK: i16x8.abs # encoding: [0xfd,0xe2,0x01] - i16x8.abs - - # CHECK: i32x4.abs # encoding: [0xfd,0xe3,0x01] - i32x4.abs + # CHECK: f32x4.qfma # encoding: [0xfd,0xfc,0x01] + f32x4.qfma - # CHECK: i8x16.bitmask # encoding: [0xfd,0xe4,0x01] - i8x16.bitmask + # CHECK: f32x4.qfms # encoding: [0xfd,0xfd,0x01] + f32x4.qfms - # CHECK: i16x8.bitmask # encoding: [0xfd,0xe5,0x01] - i16x8.bitmask + # CHECK: f64x2.qfma # encoding: [0xfd,0xfe,0x01] + f64x2.qfma - # CHECK: i32x4.bitmask # encoding: [0xfd,0xe6,0x01] - i32x4.bitmask + # CHECK: f64x2.qfms # encoding: [0xfd,0xff,0x01] + f64x2.qfms end_function