@@ -38,6 +38,13 @@ multiclass RELAXED_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s,
38
38
asmstr_s, simdop, HasRelaxedSIMD>;
39
39
}
40
40
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
+
41
48
42
49
defm "" : ARGUMENT<V128, v16i8>;
43
50
defm "" : ARGUMENT<V128, v8i16>;
@@ -591,6 +598,14 @@ defm "" : Splat<I64x2, 18>;
591
598
defm "" : Splat<F32x4, 19>;
592
599
defm "" : Splat<F64x2, 20>;
593
600
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
+
594
609
// scalar_to_vector leaves high lanes undefined, so can be a splat
595
610
foreach vec = AllVecs in
596
611
def : Pat<(vec.vt (scalar_to_vector (vec.lane_vt vec.lane_rc:$x))),
0 commit comments