1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp %s -o - | FileCheck %s
4 declare i64 @llvm.vector.reduce.add.i64.v2i64(<2 x i64>)
5 declare i32 @llvm.vector.reduce.add.i32.v4i32(<4 x i32>)
6 declare i32 @llvm.vector.reduce.add.i32.v8i32(<8 x i32>)
7 declare i16 @llvm.vector.reduce.add.i16.v8i16(<8 x i16>)
8 declare i16 @llvm.vector.reduce.add.i16.v16i16(<16 x i16>)
9 declare i8 @llvm.vector.reduce.add.i8.v16i8(<16 x i8>)
10 declare i8 @llvm.vector.reduce.add.i8.v32i8(<32 x i8>)
12 define arm_aapcs_vfpcc i64 @vaddv_v2i64_i64(<2 x i64> %s1) {
13 ; CHECK-LABEL: vaddv_v2i64_i64:
14 ; CHECK: @ %bb.0: @ %entry
15 ; CHECK-NEXT: vmov r0, r1, d1
16 ; CHECK-NEXT: vmov r2, r3, d0
17 ; CHECK-NEXT: adds r0, r0, r2
18 ; CHECK-NEXT: adcs r1, r3
21 %r = call i64 @llvm.vector.reduce.add.i64.v2i64(<2 x i64> %s1)
25 define arm_aapcs_vfpcc i32 @vaddv_v4i32_i32(<4 x i32> %s1) {
26 ; CHECK-LABEL: vaddv_v4i32_i32:
27 ; CHECK: @ %bb.0: @ %entry
28 ; CHECK-NEXT: vaddv.u32 r0, q0
31 %r = call i32 @llvm.vector.reduce.add.i32.v4i32(<4 x i32> %s1)
35 define arm_aapcs_vfpcc i32 @vaddv_v8i32_i32(<8 x i32> %s1) {
36 ; CHECK-LABEL: vaddv_v8i32_i32:
37 ; CHECK: @ %bb.0: @ %entry
38 ; CHECK-NEXT: vaddv.u32 r0, q1
39 ; CHECK-NEXT: vaddva.u32 r0, q0
42 %r = call i32 @llvm.vector.reduce.add.i32.v8i32(<8 x i32> %s1)
46 define arm_aapcs_vfpcc i16 @vaddv_v8i16_i16(<8 x i16> %s1) {
47 ; CHECK-LABEL: vaddv_v8i16_i16:
48 ; CHECK: @ %bb.0: @ %entry
49 ; CHECK-NEXT: vaddv.u16 r0, q0
52 %r = call i16 @llvm.vector.reduce.add.i16.v8i16(<8 x i16> %s1)
56 define arm_aapcs_vfpcc i16 @vaddv_v16i16_i16(<16 x i16> %s1) {
57 ; CHECK-LABEL: vaddv_v16i16_i16:
58 ; CHECK: @ %bb.0: @ %entry
59 ; CHECK-NEXT: vaddv.u16 r0, q1
60 ; CHECK-NEXT: vaddva.u16 r0, q0
63 %r = call i16 @llvm.vector.reduce.add.i16.v16i16(<16 x i16> %s1)
67 define arm_aapcs_vfpcc i8 @vaddv_v16i8_i8(<16 x i8> %s1) {
68 ; CHECK-LABEL: vaddv_v16i8_i8:
69 ; CHECK: @ %bb.0: @ %entry
70 ; CHECK-NEXT: vaddv.u8 r0, q0
73 %r = call i8 @llvm.vector.reduce.add.i8.v16i8(<16 x i8> %s1)
77 define arm_aapcs_vfpcc i8 @vaddv_v32i8_i8(<32 x i8> %s1) {
78 ; CHECK-LABEL: vaddv_v32i8_i8:
79 ; CHECK: @ %bb.0: @ %entry
80 ; CHECK-NEXT: vaddv.u8 r0, q1
81 ; CHECK-NEXT: vaddva.u8 r0, q0
84 %r = call i8 @llvm.vector.reduce.add.i8.v32i8(<32 x i8> %s1)
88 define arm_aapcs_vfpcc i64 @vaddva_v2i64_i64(<2 x i64> %s1, i64 %x) {
89 ; CHECK-LABEL: vaddva_v2i64_i64:
90 ; CHECK: @ %bb.0: @ %entry
91 ; CHECK-NEXT: .save {r7, lr}
92 ; CHECK-NEXT: push {r7, lr}
93 ; CHECK-NEXT: vmov lr, r12, d1
94 ; CHECK-NEXT: vmov r3, r2, d0
95 ; CHECK-NEXT: adds.w r3, r3, lr
96 ; CHECK-NEXT: adc.w r2, r2, r12
97 ; CHECK-NEXT: adds r0, r0, r3
98 ; CHECK-NEXT: adcs r1, r2
99 ; CHECK-NEXT: pop {r7, pc}
101 %t = call i64 @llvm.vector.reduce.add.i64.v2i64(<2 x i64> %s1)
106 define arm_aapcs_vfpcc i32 @vaddva_v4i32_i32(<4 x i32> %s1, i32 %x) {
107 ; CHECK-LABEL: vaddva_v4i32_i32:
108 ; CHECK: @ %bb.0: @ %entry
109 ; CHECK-NEXT: vaddva.u32 r0, q0
112 %t = call i32 @llvm.vector.reduce.add.i32.v4i32(<4 x i32> %s1)
117 define arm_aapcs_vfpcc i32 @vaddva_v8i32_i32(<8 x i32> %s1, i32 %x) {
118 ; CHECK-LABEL: vaddva_v8i32_i32:
119 ; CHECK: @ %bb.0: @ %entry
120 ; CHECK-NEXT: vaddva.u32 r0, q0
121 ; CHECK-NEXT: vaddva.u32 r0, q1
124 %t = call i32 @llvm.vector.reduce.add.i32.v8i32(<8 x i32> %s1)
129 define arm_aapcs_vfpcc i16 @vaddva_v8i16_i16(<8 x i16> %s1, i16 %x) {
130 ; CHECK-LABEL: vaddva_v8i16_i16:
131 ; CHECK: @ %bb.0: @ %entry
132 ; CHECK-NEXT: vaddva.u16 r0, q0
135 %t = call i16 @llvm.vector.reduce.add.i16.v8i16(<8 x i16> %s1)
140 define arm_aapcs_vfpcc i16 @vaddva_v16i16_i16(<16 x i16> %s1, i16 %x) {
141 ; CHECK-LABEL: vaddva_v16i16_i16:
142 ; CHECK: @ %bb.0: @ %entry
143 ; CHECK-NEXT: vaddva.u16 r0, q0
144 ; CHECK-NEXT: vaddva.u16 r0, q1
147 %t = call i16 @llvm.vector.reduce.add.i16.v16i16(<16 x i16> %s1)
152 define arm_aapcs_vfpcc i8 @vaddva_v16i8_i8(<16 x i8> %s1, i8 %x) {
153 ; CHECK-LABEL: vaddva_v16i8_i8:
154 ; CHECK: @ %bb.0: @ %entry
155 ; CHECK-NEXT: vaddva.u8 r0, q0
158 %t = call i8 @llvm.vector.reduce.add.i8.v16i8(<16 x i8> %s1)
163 define arm_aapcs_vfpcc i8 @vaddva_v32i8_i8(<32 x i8> %s1, i8 %x) {
164 ; CHECK-LABEL: vaddva_v32i8_i8:
165 ; CHECK: @ %bb.0: @ %entry
166 ; CHECK-NEXT: vaddva.u8 r0, q0
167 ; CHECK-NEXT: vaddva.u8 r0, q1
170 %t = call i8 @llvm.vector.reduce.add.i8.v32i8(<32 x i8> %s1)