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
5 target triple = "aarch64-unknown-linux-gnu"
7 define <4 x i8> @sdiv_v4i8(<4 x i8> %op1) {
8 ; CHECK-LABEL: sdiv_v4i8:
10 ; CHECK-NEXT: ptrue p0.h, vl4
11 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
12 ; CHECK-NEXT: sxtb z0.h, p0/m, z0.h
13 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
14 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
16 %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)
20 define <8 x i8> @sdiv_v8i8(<8 x i8> %op1) {
21 ; CHECK-LABEL: sdiv_v8i8:
23 ; CHECK-NEXT: ptrue p0.b, vl8
24 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
25 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
26 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
28 %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)
32 define <16 x i8> @sdiv_v16i8(<16 x i8> %op1) {
33 ; CHECK-LABEL: sdiv_v16i8:
35 ; CHECK-NEXT: ptrue p0.b, vl16
36 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
37 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
38 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
40 %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)
44 define void @sdiv_v32i8(ptr %a) {
45 ; CHECK-LABEL: sdiv_v32i8:
47 ; CHECK-NEXT: ptrue p0.b, vl16
48 ; CHECK-NEXT: ldp q0, q1, [x0]
49 ; CHECK-NEXT: asrd z0.b, p0/m, z0.b, #5
50 ; CHECK-NEXT: asrd z1.b, p0/m, z1.b, #5
51 ; CHECK-NEXT: stp q0, q1, [x0]
53 %op1 = load <32 x i8>, ptr %a
54 %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)
55 store <32 x i8> %res, ptr %a
59 define <2 x i16> @sdiv_v2i16(<2 x i16> %op1) {
60 ; CHECK-LABEL: sdiv_v2i16:
62 ; CHECK-NEXT: ptrue p0.s, vl2
63 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
64 ; CHECK-NEXT: sxth z0.s, p0/m, z0.s
65 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
66 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
68 %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)
72 define <4 x i16> @sdiv_v4i16(<4 x i16> %op1) {
73 ; CHECK-LABEL: sdiv_v4i16:
75 ; CHECK-NEXT: ptrue p0.h, vl4
76 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
77 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
78 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
80 %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)
84 define <8 x i16> @sdiv_v8i16(<8 x i16> %op1) {
85 ; CHECK-LABEL: sdiv_v8i16:
87 ; CHECK-NEXT: ptrue p0.h, vl8
88 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
89 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
90 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
92 %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)
96 define void @sdiv_v16i16(ptr %a) {
97 ; CHECK-LABEL: sdiv_v16i16:
99 ; CHECK-NEXT: ptrue p0.h, vl8
100 ; CHECK-NEXT: ldp q0, q1, [x0]
101 ; CHECK-NEXT: asrd z0.h, p0/m, z0.h, #5
102 ; CHECK-NEXT: asrd z1.h, p0/m, z1.h, #5
103 ; CHECK-NEXT: stp q0, q1, [x0]
105 %op1 = load <16 x i16>, ptr %a
106 %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)
107 store <16 x i16> %res, ptr %a
111 define <2 x i32> @sdiv_v2i32(<2 x i32> %op1) {
112 ; CHECK-LABEL: sdiv_v2i32:
114 ; CHECK-NEXT: ptrue p0.s, vl2
115 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
116 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
117 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
119 %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)
123 define <4 x i32> @sdiv_v4i32(<4 x i32> %op1) {
124 ; CHECK-LABEL: sdiv_v4i32:
126 ; CHECK-NEXT: ptrue p0.s, vl4
127 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
128 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
129 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
131 %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)
135 define void @sdiv_v8i32(ptr %a) {
136 ; CHECK-LABEL: sdiv_v8i32:
138 ; CHECK-NEXT: ptrue p0.s, vl4
139 ; CHECK-NEXT: ldp q0, q1, [x0]
140 ; CHECK-NEXT: asrd z0.s, p0/m, z0.s, #5
141 ; CHECK-NEXT: asrd z1.s, p0/m, z1.s, #5
142 ; CHECK-NEXT: stp q0, q1, [x0]
144 %op1 = load <8 x i32>, ptr %a
145 %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)
146 store <8 x i32> %res, ptr %a
150 define <1 x i64> @sdiv_v1i64(<1 x i64> %op1) {
151 ; CHECK-LABEL: sdiv_v1i64:
153 ; CHECK-NEXT: ptrue p0.d, vl1
154 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
155 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
156 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
158 %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)
162 ; Vector i64 sdiv are not legal for NEON so use SVE when available.
163 define <2 x i64> @sdiv_v2i64(<2 x i64> %op1) {
164 ; CHECK-LABEL: sdiv_v2i64:
166 ; CHECK-NEXT: ptrue p0.d, vl2
167 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
168 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
169 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
171 %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)
175 define void @sdiv_v4i64(ptr %a) {
176 ; CHECK-LABEL: sdiv_v4i64:
178 ; CHECK-NEXT: ptrue p0.d, vl2
179 ; CHECK-NEXT: ldp q0, q1, [x0]
180 ; CHECK-NEXT: asrd z0.d, p0/m, z0.d, #5
181 ; CHECK-NEXT: asrd z1.d, p0/m, z1.d, #5
182 ; CHECK-NEXT: stp q0, q1, [x0]
184 %op1 = load <4 x i64>, ptr %a
185 %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)
186 store <4 x i64> %res, ptr %a