@@ -38,6 +38,13 @@ multiclass RELAXED_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s,
3838 asmstr_s, simdop, HasRelaxedSIMD>;
3939}
4040
41+ multiclass HALF_PRECISION_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s,
42+ list<dag> pattern_r, string asmstr_r = "",
43+ string asmstr_s = "", bits<32> simdop = -1> {
44+ defm "" : ABSTRACT_SIMD_I<oops_r, iops_r, oops_s, iops_s, pattern_r, asmstr_r,
45+ asmstr_s, simdop, HasHalfPrecision>;
46+ }
47+
4148
4249defm "" : ARGUMENT<V128, v16i8>;
4350defm "" : ARGUMENT<V128, v8i16>;
@@ -591,6 +598,14 @@ defm "" : Splat<I64x2, 18>;
591598defm "" : Splat<F32x4, 19>;
592599defm "" : Splat<F64x2, 20>;
593600
601+ // Half values are not fully supported so an intrinsic is used instead of a
602+ // regular Splat pattern as above.
603+ defm SPLAT_F16x8 :
604+ HALF_PRECISION_I<(outs V128:$dst), (ins F32:$x),
605+ (outs), (ins),
606+ [(set (v8f16 V128:$dst), (int_wasm_splat_f16x8 F32:$x))],
607+ "f16x8.splat\t$dst, $x", "f16x8.splat", 0x120>;
608+
594609// scalar_to_vector leaves high lanes undefined, so can be a splat
595610foreach vec = AllVecs in
596611def : Pat<(vec.vt (scalar_to_vector (vec.lane_vt vec.lane_rc:$x))),
0 commit comments