defm : InsertEltF16<f16, v4f16, v8f16>;
-//def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
-// (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
(INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
(INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
+def : Pat<(v4f16 (scalar_to_vector (f16 HPR:$src))),
+ (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
+def : Pat<(v8f16 (scalar_to_vector (f16 HPR:$src))),
+ (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
+
def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
(VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
ret float %conv
}
+define <4 x half> @insert_v4f16(half %a) {
+; CHECKHARD-LABEL: insert_v4f16:
+; CHECKHARD: @ %bb.0: @ %entry
+; CHECKHARD-NEXT: @ kill: def $s0 killed $s0 def $d0
+; CHECKHARD-NEXT: bx lr
+;
+; CHECKSOFT-LABEL: insert_v4f16:
+; CHECKSOFT: @ %bb.0: @ %entry
+; CHECKSOFT-NEXT: vmov.f16 s0, r0
+; CHECKSOFT-NEXT: vmov r0, r1, d0
+; CHECKSOFT-NEXT: bx lr
+entry:
+ %res = insertelement <4 x half> undef, half %a, i32 0
+ ret <4 x half> %res
+}
+
+define <8 x half> @insert_v8f16(half %a) {
+; CHECKHARD-LABEL: insert_v8f16:
+; CHECKHARD: @ %bb.0: @ %entry
+; CHECKHARD-NEXT: @ kill: def $s0 killed $s0 def $q0
+; CHECKHARD-NEXT: bx lr
+;
+; CHECKSOFT-LABEL: insert_v8f16:
+; CHECKSOFT: @ %bb.0: @ %entry
+; CHECKSOFT-NEXT: vmov.f16 s0, r0
+; CHECKSOFT-NEXT: vmov r2, r3, d1
+; CHECKSOFT-NEXT: vmov r0, r1, d0
+; CHECKSOFT-NEXT: bx lr
+entry:
+ %res = insertelement <8 x half> undef, half %a, i32 0
+ ret <8 x half> %res
+}
+
define <4 x half> @test_vset_lane_f16(<4 x half> %a, float %fb) nounwind {
; CHECKHARD-LABEL: test_vset_lane_f16:
; CHECKHARD: @ %bb.0: @ %entry