1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s
6 target triple = "aarch64-unknown-linux-gnu"
8 define <4 x i8> @sdiv_v4i8(<4 x i8> %op1) {
9 ; CHECK-LABEL: sdiv_v4i8:
11 ; CHECK-NEXT: ptrue p0.h, vl4
12 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
13 ; CHECK-NEXT: sxtb z0.h, p0/m, z0.h
14 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
15 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
17 %res = sdiv <4 x i8> %op1, shufflevector (<4 x i8> insertelement (<4 x i8> poison, i8 32, i32 0), <4 x i8> poison, <4 x i32> zeroinitializer)
21 define <8 x i8> @sdiv_v8i8(<8 x i8> %op1) {
22 ; CHECK-LABEL: sdiv_v8i8:
24 ; CHECK-NEXT: ptrue p0.b, vl8
25 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
26 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
27 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
29 %res = sdiv <8 x i8> %op1, shufflevector (<8 x i8> insertelement (<8 x i8> poison, i8 32, i32 0), <8 x i8> poison, <8 x i32> zeroinitializer)
33 define <16 x i8> @sdiv_v16i8(<16 x i8> %op1) {
34 ; CHECK-LABEL: sdiv_v16i8:
36 ; CHECK-NEXT: ptrue p0.b, vl16
37 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
38 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
39 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
41 %res = sdiv <16 x i8> %op1, shufflevector (<16 x i8> insertelement (<16 x i8> poison, i8 32, i32 0), <16 x i8> poison, <16 x i32> zeroinitializer)
45 define void @sdiv_v32i8(ptr %a) {
46 ; CHECK-LABEL: sdiv_v32i8:
48 ; CHECK-NEXT: ptrue p0.b, vl16
49 ; CHECK-NEXT: ldp q0, q1, [x0]
50 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
51 ; CHECK-NEXT: asrd z1.b, p0/m, z1.b, #5
52 ; CHECK-NEXT: stp q0, q1, [x0]
54 %op1 = load <32 x i8>, ptr %a
55 %res = sdiv <32 x i8> %op1, shufflevector (<32 x i8> insertelement (<32 x i8> poison, i8 32, i32 0), <32 x i8> poison, <32 x i32> zeroinitializer)
56 store <32 x i8> %res, ptr %a
60 define <2 x i16> @sdiv_v2i16(<2 x i16> %op1) {
61 ; CHECK-LABEL: sdiv_v2i16:
63 ; CHECK-NEXT: ptrue p0.s, vl2
64 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
65 ; CHECK-NEXT: sxth z0.s, p0/m, z0.s
66 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
67 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
69 %res = sdiv <2 x i16> %op1, shufflevector (<2 x i16> insertelement (<2 x i16> poison, i16 32, i32 0), <2 x i16> poison, <2 x i32> zeroinitializer)
73 define <4 x i16> @sdiv_v4i16(<4 x i16> %op1) {
74 ; CHECK-LABEL: sdiv_v4i16:
76 ; CHECK-NEXT: ptrue p0.h, vl4
77 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
78 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
79 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
81 %res = sdiv <4 x i16> %op1, shufflevector (<4 x i16> insertelement (<4 x i16> poison, i16 32, i32 0), <4 x i16> poison, <4 x i32> zeroinitializer)
85 define <8 x i16> @sdiv_v8i16(<8 x i16> %op1) {
86 ; CHECK-LABEL: sdiv_v8i16:
88 ; CHECK-NEXT: ptrue p0.h, vl8
89 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
90 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
91 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
93 %res = sdiv <8 x i16> %op1, shufflevector (<8 x i16> insertelement (<8 x i16> poison, i16 32, i32 0), <8 x i16> poison, <8 x i32> zeroinitializer)
97 define void @sdiv_v16i16(ptr %a) {
98 ; CHECK-LABEL: sdiv_v16i16:
100 ; CHECK-NEXT: ptrue p0.h, vl8
101 ; CHECK-NEXT: ldp q0, q1, [x0]
102 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
103 ; CHECK-NEXT: asrd z1.h, p0/m, z1.h, #5
104 ; CHECK-NEXT: stp q0, q1, [x0]
106 %op1 = load <16 x i16>, ptr %a
107 %res = sdiv <16 x i16> %op1, shufflevector (<16 x i16> insertelement (<16 x i16> poison, i16 32, i32 0), <16 x i16> poison, <16 x i32> zeroinitializer)
108 store <16 x i16> %res, ptr %a
112 define <2 x i32> @sdiv_v2i32(<2 x i32> %op1) {
113 ; CHECK-LABEL: sdiv_v2i32:
115 ; CHECK-NEXT: ptrue p0.s, vl2
116 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
117 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
118 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
120 %res = sdiv <2 x i32> %op1, shufflevector (<2 x i32> insertelement (<2 x i32> poison, i32 32, i32 0), <2 x i32> poison, <2 x i32> zeroinitializer)
124 define <4 x i32> @sdiv_v4i32(<4 x i32> %op1) {
125 ; CHECK-LABEL: sdiv_v4i32:
127 ; CHECK-NEXT: ptrue p0.s, vl4
128 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
129 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
130 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
132 %res = sdiv <4 x i32> %op1, shufflevector (<4 x i32> insertelement (<4 x i32> poison, i32 32, i32 0), <4 x i32> poison, <4 x i32> zeroinitializer)
136 define void @sdiv_v8i32(ptr %a) {
137 ; CHECK-LABEL: sdiv_v8i32:
139 ; CHECK-NEXT: ptrue p0.s, vl4
140 ; CHECK-NEXT: ldp q0, q1, [x0]
141 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
142 ; CHECK-NEXT: asrd z1.s, p0/m, z1.s, #5
143 ; CHECK-NEXT: stp q0, q1, [x0]
145 %op1 = load <8 x i32>, ptr %a
146 %res = sdiv <8 x i32> %op1, shufflevector (<8 x i32> insertelement (<8 x i32> poison, i32 32, i32 0), <8 x i32> poison, <8 x i32> zeroinitializer)
147 store <8 x i32> %res, ptr %a
151 define <1 x i64> @sdiv_v1i64(<1 x i64> %op1) {
152 ; CHECK-LABEL: sdiv_v1i64:
154 ; CHECK-NEXT: ptrue p0.d, vl1
155 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
156 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
157 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
159 %res = sdiv <1 x i64> %op1, shufflevector (<1 x i64> insertelement (<1 x i64> poison, i64 32, i32 0), <1 x i64> poison, <1 x i32> zeroinitializer)
163 ; Vector i64 sdiv are not legal for NEON so use SVE when available.
164 define <2 x i64> @sdiv_v2i64(<2 x i64> %op1) {
165 ; CHECK-LABEL: sdiv_v2i64:
167 ; CHECK-NEXT: ptrue p0.d, vl2
168 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
169 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
170 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
172 %res = sdiv <2 x i64> %op1, shufflevector (<2 x i64> insertelement (<2 x i64> poison, i64 32, i32 0), <2 x i64> poison, <2 x i32> zeroinitializer)
176 define void @sdiv_v4i64(ptr %a) {
177 ; CHECK-LABEL: sdiv_v4i64:
179 ; CHECK-NEXT: ptrue p0.d, vl2
180 ; CHECK-NEXT: ldp q0, q1, [x0]
181 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
182 ; CHECK-NEXT: asrd z1.d, p0/m, z1.d, #5
183 ; CHECK-NEXT: stp q0, q1, [x0]
185 %op1 = load <4 x i64>, ptr %a
186 %res = sdiv <4 x i64> %op1, shufflevector (<4 x i64> insertelement (<4 x i64> poison, i64 32, i32 0), <4 x i64> poison, <4 x i32> zeroinitializer)
187 store <4 x i64> %res, ptr %a