1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
3 ;; Splats of legal integer vector types
5 define <vscale x 16 x i8> @sve_splat_16xi8(i8 %val) {
6 ; CHECK-LABEL: @sve_splat_16xi8
9 %ins = insertelement <vscale x 16 x i8> undef, i8 %val, i32 0
10 %splat = shufflevector <vscale x 16 x i8> %ins, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
11 ret <vscale x 16 x i8> %splat
14 define <vscale x 8 x i16> @sve_splat_8xi16(i16 %val) {
15 ; CHECK-LABEL: @sve_splat_8xi16
18 %ins = insertelement <vscale x 8 x i16> undef, i16 %val, i32 0
19 %splat = shufflevector <vscale x 8 x i16> %ins, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
20 ret <vscale x 8 x i16> %splat
23 define <vscale x 4 x i32> @sve_splat_4xi32(i32 %val) {
24 ; CHECK-LABEL: @sve_splat_4xi32
27 %ins = insertelement <vscale x 4 x i32> undef, i32 %val, i32 0
28 %splat = shufflevector <vscale x 4 x i32> %ins, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
29 ret <vscale x 4 x i32> %splat
32 define <vscale x 2 x i64> @sve_splat_2xi64(i64 %val) {
33 ; CHECK-LABEL: @sve_splat_2xi64
36 %ins = insertelement <vscale x 2 x i64> undef, i64 %val, i32 0
37 %splat = shufflevector <vscale x 2 x i64> %ins, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
38 ret <vscale x 2 x i64> %splat
41 ;; Promote splats of smaller illegal integer vector types
43 define <vscale x 2 x i8> @sve_splat_2xi8(i8 %val) {
44 ; CHECK-LABEL: @sve_splat_2xi8
47 %ins = insertelement <vscale x 2 x i8> undef, i8 %val, i32 0
48 %splat = shufflevector <vscale x 2 x i8> %ins, <vscale x 2 x i8> undef, <vscale x 2 x i32> zeroinitializer
49 ret <vscale x 2 x i8> %splat
52 define <vscale x 4 x i8> @sve_splat_4xi8(i8 %val) {
53 ; CHECK-LABEL: @sve_splat_4xi8
56 %ins = insertelement <vscale x 4 x i8> undef, i8 %val, i32 0
57 %splat = shufflevector <vscale x 4 x i8> %ins, <vscale x 4 x i8> undef, <vscale x 4 x i32> zeroinitializer
58 ret <vscale x 4 x i8> %splat
61 define <vscale x 8 x i8> @sve_splat_8xi8(i8 %val) {
62 ; CHECK-LABEL: @sve_splat_8xi8
65 %ins = insertelement <vscale x 8 x i8> undef, i8 %val, i32 0
66 %splat = shufflevector <vscale x 8 x i8> %ins, <vscale x 8 x i8> undef, <vscale x 8 x i32> zeroinitializer
67 ret <vscale x 8 x i8> %splat
70 define <vscale x 2 x i16> @sve_splat_2xi16(i16 %val) {
71 ; CHECK-LABEL: @sve_splat_2xi16
74 %ins = insertelement <vscale x 2 x i16> undef, i16 %val, i32 0
75 %splat = shufflevector <vscale x 2 x i16> %ins, <vscale x 2 x i16> undef, <vscale x 2 x i32> zeroinitializer
76 ret <vscale x 2 x i16> %splat
79 define <vscale x 4 x i16> @sve_splat_4xi16(i16 %val) {
80 ; CHECK-LABEL: @sve_splat_4xi16
83 %ins = insertelement <vscale x 4 x i16> undef, i16 %val, i32 0
84 %splat = shufflevector <vscale x 4 x i16> %ins, <vscale x 4 x i16> undef, <vscale x 4 x i32> zeroinitializer
85 ret <vscale x 4 x i16> %splat
88 define <vscale x 2 x i32> @sve_splat_2xi32(i32 %val) {
89 ; CHECK-LABEL: @sve_splat_2xi32
92 %ins = insertelement <vscale x 2 x i32> undef, i32 %val, i32 0
93 %splat = shufflevector <vscale x 2 x i32> %ins, <vscale x 2 x i32> undef, <vscale x 2 x i32> zeroinitializer
94 ret <vscale x 2 x i32> %splat