1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=arm64-none-linux-gnu -mattr=+neon < %s | FileCheck %s
4 declare <8 x i8> @llvm.aarch64.neon.uabd.v8i8(<8 x i8>, <8 x i8>)
5 declare <8 x i8> @llvm.aarch64.neon.sabd.v8i8(<8 x i8>, <8 x i8>)
7 define <8 x i8> @test_uabd_v8i8(<8 x i8> %lhs, <8 x i8> %rhs) {
8 ; CHECK-LABEL: test_uabd_v8i8:
10 ; CHECK-NEXT: uabd v0.8b, v0.8b, v1.8b
12 %abd = call <8 x i8> @llvm.aarch64.neon.uabd.v8i8(<8 x i8> %lhs, <8 x i8> %rhs)
16 define <8 x i8> @test_uaba_v8i8(<8 x i8> %lhs, <8 x i8> %rhs) {
17 ; CHECK-LABEL: test_uaba_v8i8:
19 ; CHECK-NEXT: uaba v0.8b, v0.8b, v1.8b
21 %abd = call <8 x i8> @llvm.aarch64.neon.uabd.v8i8(<8 x i8> %lhs, <8 x i8> %rhs)
22 %aba = add <8 x i8> %lhs, %abd
26 define <8 x i8> @test_sabd_v8i8(<8 x i8> %lhs, <8 x i8> %rhs) {
27 ; CHECK-LABEL: test_sabd_v8i8:
29 ; CHECK-NEXT: sabd v0.8b, v0.8b, v1.8b
31 %abd = call <8 x i8> @llvm.aarch64.neon.sabd.v8i8(<8 x i8> %lhs, <8 x i8> %rhs)
35 define <8 x i8> @test_saba_v8i8(<8 x i8> %lhs, <8 x i8> %rhs) {
36 ; CHECK-LABEL: test_saba_v8i8:
38 ; CHECK-NEXT: saba v0.8b, v0.8b, v1.8b
40 %abd = call <8 x i8> @llvm.aarch64.neon.sabd.v8i8(<8 x i8> %lhs, <8 x i8> %rhs)
41 %aba = add <8 x i8> %lhs, %abd
45 declare <16 x i8> @llvm.aarch64.neon.uabd.v16i8(<16 x i8>, <16 x i8>)
46 declare <16 x i8> @llvm.aarch64.neon.sabd.v16i8(<16 x i8>, <16 x i8>)
48 define <16 x i8> @test_uabd_v16i8(<16 x i8> %lhs, <16 x i8> %rhs) {
49 ; CHECK-LABEL: test_uabd_v16i8:
51 ; CHECK-NEXT: uabd v0.16b, v0.16b, v1.16b
53 %abd = call <16 x i8> @llvm.aarch64.neon.uabd.v16i8(<16 x i8> %lhs, <16 x i8> %rhs)
57 define <16 x i8> @test_uaba_v16i8(<16 x i8> %lhs, <16 x i8> %rhs) {
58 ; CHECK-LABEL: test_uaba_v16i8:
60 ; CHECK-NEXT: uaba v0.16b, v0.16b, v1.16b
62 %abd = call <16 x i8> @llvm.aarch64.neon.uabd.v16i8(<16 x i8> %lhs, <16 x i8> %rhs)
63 %aba = add <16 x i8> %lhs, %abd
67 define <16 x i8> @test_sabd_v16i8(<16 x i8> %lhs, <16 x i8> %rhs) {
68 ; CHECK-LABEL: test_sabd_v16i8:
70 ; CHECK-NEXT: sabd v0.16b, v0.16b, v1.16b
72 %abd = call <16 x i8> @llvm.aarch64.neon.sabd.v16i8(<16 x i8> %lhs, <16 x i8> %rhs)
76 define <16 x i8> @test_saba_v16i8(<16 x i8> %lhs, <16 x i8> %rhs) {
77 ; CHECK-LABEL: test_saba_v16i8:
79 ; CHECK-NEXT: saba v0.16b, v0.16b, v1.16b
81 %abd = call <16 x i8> @llvm.aarch64.neon.sabd.v16i8(<16 x i8> %lhs, <16 x i8> %rhs)
82 %aba = add <16 x i8> %lhs, %abd
86 declare <4 x i16> @llvm.aarch64.neon.uabd.v4i16(<4 x i16>, <4 x i16>)
87 declare <4 x i16> @llvm.aarch64.neon.sabd.v4i16(<4 x i16>, <4 x i16>)
89 define <4 x i16> @test_uabd_v4i16(<4 x i16> %lhs, <4 x i16> %rhs) {
90 ; CHECK-LABEL: test_uabd_v4i16:
92 ; CHECK-NEXT: uabd v0.4h, v0.4h, v1.4h
94 %abd = call <4 x i16> @llvm.aarch64.neon.uabd.v4i16(<4 x i16> %lhs, <4 x i16> %rhs)
98 define <4 x i16> @test_uaba_v4i16(<4 x i16> %lhs, <4 x i16> %rhs) {
99 ; CHECK-LABEL: test_uaba_v4i16:
101 ; CHECK-NEXT: uaba v0.4h, v0.4h, v1.4h
103 %abd = call <4 x i16> @llvm.aarch64.neon.uabd.v4i16(<4 x i16> %lhs, <4 x i16> %rhs)
104 %aba = add <4 x i16> %lhs, %abd
108 define <4 x i16> @test_sabd_v4i16(<4 x i16> %lhs, <4 x i16> %rhs) {
109 ; CHECK-LABEL: test_sabd_v4i16:
111 ; CHECK-NEXT: sabd v0.4h, v0.4h, v1.4h
113 %abd = call <4 x i16> @llvm.aarch64.neon.sabd.v4i16(<4 x i16> %lhs, <4 x i16> %rhs)
117 define <4 x i16> @test_saba_v4i16(<4 x i16> %lhs, <4 x i16> %rhs) {
118 ; CHECK-LABEL: test_saba_v4i16:
120 ; CHECK-NEXT: saba v0.4h, v0.4h, v1.4h
122 %abd = call <4 x i16> @llvm.aarch64.neon.sabd.v4i16(<4 x i16> %lhs, <4 x i16> %rhs)
123 %aba = add <4 x i16> %lhs, %abd
127 declare <8 x i16> @llvm.aarch64.neon.uabd.v8i16(<8 x i16>, <8 x i16>)
128 declare <8 x i16> @llvm.aarch64.neon.sabd.v8i16(<8 x i16>, <8 x i16>)
130 define <8 x i16> @test_uabd_v8i16(<8 x i16> %lhs, <8 x i16> %rhs) {
131 ; CHECK-LABEL: test_uabd_v8i16:
133 ; CHECK-NEXT: uabd v0.8h, v0.8h, v1.8h
135 %abd = call <8 x i16> @llvm.aarch64.neon.uabd.v8i16(<8 x i16> %lhs, <8 x i16> %rhs)
139 define <8 x i16> @test_uaba_v8i16(<8 x i16> %lhs, <8 x i16> %rhs) {
140 ; CHECK-LABEL: test_uaba_v8i16:
142 ; CHECK-NEXT: uaba v0.8h, v0.8h, v1.8h
144 %abd = call <8 x i16> @llvm.aarch64.neon.uabd.v8i16(<8 x i16> %lhs, <8 x i16> %rhs)
145 %aba = add <8 x i16> %lhs, %abd
149 define <8 x i16> @test_sabd_v8i16(<8 x i16> %lhs, <8 x i16> %rhs) {
150 ; CHECK-LABEL: test_sabd_v8i16:
152 ; CHECK-NEXT: sabd v0.8h, v0.8h, v1.8h
154 %abd = call <8 x i16> @llvm.aarch64.neon.sabd.v8i16(<8 x i16> %lhs, <8 x i16> %rhs)
158 define <8 x i16> @test_saba_v8i16(<8 x i16> %lhs, <8 x i16> %rhs) {
159 ; CHECK-LABEL: test_saba_v8i16:
161 ; CHECK-NEXT: saba v0.8h, v0.8h, v1.8h
163 %abd = call <8 x i16> @llvm.aarch64.neon.sabd.v8i16(<8 x i16> %lhs, <8 x i16> %rhs)
164 %aba = add <8 x i16> %lhs, %abd
168 declare <2 x i32> @llvm.aarch64.neon.uabd.v2i32(<2 x i32>, <2 x i32>)
169 declare <2 x i32> @llvm.aarch64.neon.sabd.v2i32(<2 x i32>, <2 x i32>)
171 define <2 x i32> @test_uabd_v2i32(<2 x i32> %lhs, <2 x i32> %rhs) {
172 ; CHECK-LABEL: test_uabd_v2i32:
174 ; CHECK-NEXT: uabd v0.2s, v0.2s, v1.2s
176 %abd = call <2 x i32> @llvm.aarch64.neon.uabd.v2i32(<2 x i32> %lhs, <2 x i32> %rhs)
180 define <2 x i32> @test_uaba_v2i32(<2 x i32> %lhs, <2 x i32> %rhs) {
181 ; CHECK-LABEL: test_uaba_v2i32:
183 ; CHECK-NEXT: uaba v0.2s, v0.2s, v1.2s
185 %abd = call <2 x i32> @llvm.aarch64.neon.uabd.v2i32(<2 x i32> %lhs, <2 x i32> %rhs)
186 %aba = add <2 x i32> %lhs, %abd
190 define <2 x i32> @test_sabd_v2i32(<2 x i32> %lhs, <2 x i32> %rhs) {
191 ; CHECK-LABEL: test_sabd_v2i32:
193 ; CHECK-NEXT: sabd v0.2s, v0.2s, v1.2s
195 %abd = call <2 x i32> @llvm.aarch64.neon.sabd.v2i32(<2 x i32> %lhs, <2 x i32> %rhs)
199 define <2 x i32> @test_sabd_v2i32_const() {
200 ; CHECK-LABEL: test_sabd_v2i32_const:
202 ; CHECK-NEXT: adrp x8, .LCPI19_0
203 ; CHECK-NEXT: ldr d0, [x8, :lo12:.LCPI19_0]
205 %1 = tail call <2 x i32> @llvm.aarch64.neon.sabd.v2i32(
206 <2 x i32> <i32 -2147483648, i32 2147450880>,
207 <2 x i32> <i32 -65536, i32 65535>)
211 define <2 x i32> @test_saba_v2i32(<2 x i32> %lhs, <2 x i32> %rhs) {
212 ; CHECK-LABEL: test_saba_v2i32:
214 ; CHECK-NEXT: saba v0.2s, v0.2s, v1.2s
216 %abd = call <2 x i32> @llvm.aarch64.neon.sabd.v2i32(<2 x i32> %lhs, <2 x i32> %rhs)
217 %aba = add <2 x i32> %lhs, %abd
221 declare <4 x i32> @llvm.aarch64.neon.uabd.v4i32(<4 x i32>, <4 x i32>)
222 declare <4 x i32> @llvm.aarch64.neon.sabd.v4i32(<4 x i32>, <4 x i32>)
224 define <4 x i32> @test_uabd_v4i32(<4 x i32> %lhs, <4 x i32> %rhs) {
225 ; CHECK-LABEL: test_uabd_v4i32:
227 ; CHECK-NEXT: uabd v0.4s, v0.4s, v1.4s
229 %abd = call <4 x i32> @llvm.aarch64.neon.uabd.v4i32(<4 x i32> %lhs, <4 x i32> %rhs)
233 define <4 x i32> @test_uaba_v4i32(<4 x i32> %lhs, <4 x i32> %rhs) {
234 ; CHECK-LABEL: test_uaba_v4i32:
236 ; CHECK-NEXT: uaba v0.4s, v0.4s, v1.4s
238 %abd = call <4 x i32> @llvm.aarch64.neon.uabd.v4i32(<4 x i32> %lhs, <4 x i32> %rhs)
239 %aba = add <4 x i32> %lhs, %abd
243 define <4 x i32> @test_sabd_v4i32(<4 x i32> %lhs, <4 x i32> %rhs) {
244 ; CHECK-LABEL: test_sabd_v4i32:
246 ; CHECK-NEXT: sabd v0.4s, v0.4s, v1.4s
248 %abd = call <4 x i32> @llvm.aarch64.neon.sabd.v4i32(<4 x i32> %lhs, <4 x i32> %rhs)
252 define <4 x i32> @test_saba_v4i32(<4 x i32> %lhs, <4 x i32> %rhs) {
253 ; CHECK-LABEL: test_saba_v4i32:
255 ; CHECK-NEXT: saba v0.4s, v0.4s, v1.4s
257 %abd = call <4 x i32> @llvm.aarch64.neon.sabd.v4i32(<4 x i32> %lhs, <4 x i32> %rhs)
258 %aba = add <4 x i32> %lhs, %abd
262 declare <2 x float> @llvm.aarch64.neon.fabd.v2f32(<2 x float>, <2 x float>)
264 define <2 x float> @test_fabd_v2f32(<2 x float> %lhs, <2 x float> %rhs) {
265 ; CHECK-LABEL: test_fabd_v2f32:
267 ; CHECK-NEXT: fabd v0.2s, v0.2s, v1.2s
269 %abd = call <2 x float> @llvm.aarch64.neon.fabd.v2f32(<2 x float> %lhs, <2 x float> %rhs)
273 declare <4 x float> @llvm.aarch64.neon.fabd.v4f32(<4 x float>, <4 x float>)
275 define <4 x float> @test_fabd_v4f32(<4 x float> %lhs, <4 x float> %rhs) {
276 ; CHECK-LABEL: test_fabd_v4f32:
278 ; CHECK-NEXT: fabd v0.4s, v0.4s, v1.4s
280 %abd = call <4 x float> @llvm.aarch64.neon.fabd.v4f32(<4 x float> %lhs, <4 x float> %rhs)
284 declare <2 x double> @llvm.aarch64.neon.fabd.v2f64(<2 x double>, <2 x double>)
286 define <2 x double> @test_fabd_v2f64(<2 x double> %lhs, <2 x double> %rhs) {
287 ; CHECK-LABEL: test_fabd_v2f64:
289 ; CHECK-NEXT: fabd v0.2d, v0.2d, v1.2d
291 %abd = call <2 x double> @llvm.aarch64.neon.fabd.v2f64(<2 x double> %lhs, <2 x double> %rhs)
292 ret <2 x double> %abd