1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=armv7-none-eabi -float-abi=hard -mattr=+neon -verify-machineinstrs | FileCheck %s
4 define i8 @test_umin_v8i8(<8 x i8> %x) {
5 ; CHECK-LABEL: test_umin_v8i8:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vpmin.u8 d16, d0, d0
8 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
9 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
10 ; CHECK-NEXT: vmov.u8 r0, d16[0]
13 %z = call i8 @llvm.vector.reduce.umin.v8i8(<8 x i8> %x)
17 define i8 @test_smin_v8i8(<8 x i8> %x) {
18 ; CHECK-LABEL: test_smin_v8i8:
19 ; CHECK: @ %bb.0: @ %entry
20 ; CHECK-NEXT: vpmin.s8 d16, d0, d0
21 ; CHECK-NEXT: vpmin.s8 d16, d16, d16
22 ; CHECK-NEXT: vpmin.s8 d16, d16, d16
23 ; CHECK-NEXT: vmov.s8 r0, d16[0]
26 %z = call i8 @llvm.vector.reduce.smin.v8i8(<8 x i8> %x)
30 define i8 @test_umax_v8i8(<8 x i8> %x) {
31 ; CHECK-LABEL: test_umax_v8i8:
32 ; CHECK: @ %bb.0: @ %entry
33 ; CHECK-NEXT: vpmax.u8 d16, d0, d0
34 ; CHECK-NEXT: vpmax.u8 d16, d16, d16
35 ; CHECK-NEXT: vpmax.u8 d16, d16, d16
36 ; CHECK-NEXT: vmov.u8 r0, d16[0]
39 %z = call i8 @llvm.vector.reduce.umax.v8i8(<8 x i8> %x)
43 define i8 @test_smax_v8i8(<8 x i8> %x) {
44 ; CHECK-LABEL: test_smax_v8i8:
45 ; CHECK: @ %bb.0: @ %entry
46 ; CHECK-NEXT: vpmax.s8 d16, d0, d0
47 ; CHECK-NEXT: vpmax.s8 d16, d16, d16
48 ; CHECK-NEXT: vpmax.s8 d16, d16, d16
49 ; CHECK-NEXT: vmov.s8 r0, d16[0]
52 %z = call i8 @llvm.vector.reduce.smax.v8i8(<8 x i8> %x)
56 define i16 @test_umin_v4i16(<4 x i16> %x) {
57 ; CHECK-LABEL: test_umin_v4i16:
58 ; CHECK: @ %bb.0: @ %entry
59 ; CHECK-NEXT: vpmin.u16 d16, d0, d0
60 ; CHECK-NEXT: vpmin.u16 d16, d16, d16
61 ; CHECK-NEXT: vmov.u16 r0, d16[0]
64 %z = call i16 @llvm.vector.reduce.umin.v4i16(<4 x i16> %x)
68 define i16 @test_smin_v4i16(<4 x i16> %x) {
69 ; CHECK-LABEL: test_smin_v4i16:
70 ; CHECK: @ %bb.0: @ %entry
71 ; CHECK-NEXT: vpmin.s16 d16, d0, d0
72 ; CHECK-NEXT: vpmin.s16 d16, d16, d16
73 ; CHECK-NEXT: vmov.s16 r0, d16[0]
76 %z = call i16 @llvm.vector.reduce.smin.v4i16(<4 x i16> %x)
80 define i16 @test_umax_v4i16(<4 x i16> %x) {
81 ; CHECK-LABEL: test_umax_v4i16:
82 ; CHECK: @ %bb.0: @ %entry
83 ; CHECK-NEXT: vpmax.u16 d16, d0, d0
84 ; CHECK-NEXT: vpmax.u16 d16, d16, d16
85 ; CHECK-NEXT: vmov.u16 r0, d16[0]
88 %z = call i16 @llvm.vector.reduce.umax.v4i16(<4 x i16> %x)
92 define i16 @test_smax_v4i16(<4 x i16> %x) {
93 ; CHECK-LABEL: test_smax_v4i16:
94 ; CHECK: @ %bb.0: @ %entry
95 ; CHECK-NEXT: vpmax.s16 d16, d0, d0
96 ; CHECK-NEXT: vpmax.s16 d16, d16, d16
97 ; CHECK-NEXT: vmov.s16 r0, d16[0]
100 %z = call i16 @llvm.vector.reduce.smax.v4i16(<4 x i16> %x)
104 define i32 @test_umin_v2i32(<2 x i32> %x) {
105 ; CHECK-LABEL: test_umin_v2i32:
106 ; CHECK: @ %bb.0: @ %entry
107 ; CHECK-NEXT: vpmin.u32 d16, d0, d0
108 ; CHECK-NEXT: vmov.32 r0, d16[0]
111 %z = call i32 @llvm.vector.reduce.umin.v2i32(<2 x i32> %x)
115 define i32 @test_smin_v2i32(<2 x i32> %x) {
116 ; CHECK-LABEL: test_smin_v2i32:
117 ; CHECK: @ %bb.0: @ %entry
118 ; CHECK-NEXT: vpmin.s32 d16, d0, d0
119 ; CHECK-NEXT: vmov.32 r0, d16[0]
122 %z = call i32 @llvm.vector.reduce.smin.v2i32(<2 x i32> %x)
126 define i32 @test_umax_v2i32(<2 x i32> %x) {
127 ; CHECK-LABEL: test_umax_v2i32:
128 ; CHECK: @ %bb.0: @ %entry
129 ; CHECK-NEXT: vpmax.u32 d16, d0, d0
130 ; CHECK-NEXT: vmov.32 r0, d16[0]
133 %z = call i32 @llvm.vector.reduce.umax.v2i32(<2 x i32> %x)
137 define i32 @test_smax_v2i32(<2 x i32> %x) {
138 ; CHECK-LABEL: test_smax_v2i32:
139 ; CHECK: @ %bb.0: @ %entry
140 ; CHECK-NEXT: vpmax.s32 d16, d0, d0
141 ; CHECK-NEXT: vmov.32 r0, d16[0]
144 %z = call i32 @llvm.vector.reduce.smax.v2i32(<2 x i32> %x)
148 define i8 @test_umin_v16i8(<16 x i8> %x) {
149 ; CHECK-LABEL: test_umin_v16i8:
150 ; CHECK: @ %bb.0: @ %entry
151 ; CHECK-NEXT: vpmin.u8 d16, d0, d1
152 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
153 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
154 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
155 ; CHECK-NEXT: vmov.u8 r0, d16[0]
158 %z = call i8 @llvm.vector.reduce.umin.v16i8(<16 x i8> %x)
162 define i16 @test_smin_v8i16(<8 x i16> %x) {
163 ; CHECK-LABEL: test_smin_v8i16:
164 ; CHECK: @ %bb.0: @ %entry
165 ; CHECK-NEXT: vpmin.s16 d16, d0, d1
166 ; CHECK-NEXT: vpmin.s16 d16, d16, d16
167 ; CHECK-NEXT: vpmin.s16 d16, d16, d16
168 ; CHECK-NEXT: vmov.s16 r0, d16[0]
171 %z = call i16 @llvm.vector.reduce.smin.v8i16(<8 x i16> %x)
175 define i32 @test_umax_v4i32(<4 x i32> %x) {
176 ; CHECK-LABEL: test_umax_v4i32:
177 ; CHECK: @ %bb.0: @ %entry
178 ; CHECK-NEXT: vpmax.u32 d16, d0, d1
179 ; CHECK-NEXT: vpmax.u32 d16, d16, d16
180 ; CHECK-NEXT: vmov.32 r0, d16[0]
183 %z = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %x)
187 define i8 @test_umin_v32i8(<32 x i8> %x) {
188 ; CHECK-LABEL: test_umin_v32i8:
189 ; CHECK: @ %bb.0: @ %entry
190 ; CHECK-NEXT: vmin.u8 q8, q0, q1
191 ; CHECK-NEXT: vpmin.u8 d16, d16, d17
192 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
193 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
194 ; CHECK-NEXT: vpmin.u8 d16, d16, d16
195 ; CHECK-NEXT: vmov.u8 r0, d16[0]
198 %z = call i8 @llvm.vector.reduce.umin.v32i8(<32 x i8> %x)
202 declare i8 @llvm.vector.reduce.umin.v8i8(<8 x i8>)
203 declare i8 @llvm.vector.reduce.smin.v8i8(<8 x i8>)
204 declare i8 @llvm.vector.reduce.umax.v8i8(<8 x i8>)
205 declare i8 @llvm.vector.reduce.smax.v8i8(<8 x i8>)
206 declare i16 @llvm.vector.reduce.umin.v4i16(<4 x i16>)
207 declare i16 @llvm.vector.reduce.smin.v4i16(<4 x i16>)
208 declare i16 @llvm.vector.reduce.umax.v4i16(<4 x i16>)
209 declare i16 @llvm.vector.reduce.smax.v4i16(<4 x i16>)
210 declare i32 @llvm.vector.reduce.umin.v2i32(<2 x i32>)
211 declare i32 @llvm.vector.reduce.smin.v2i32(<2 x i32>)
212 declare i32 @llvm.vector.reduce.umax.v2i32(<2 x i32>)
213 declare i32 @llvm.vector.reduce.smax.v2i32(<2 x i32>)
215 declare i8 @llvm.vector.reduce.umin.v16i8(<16 x i8>)
216 declare i16 @llvm.vector.reduce.smin.v8i16(<8 x i16>)
217 declare i32 @llvm.vector.reduce.umax.v4i32(<4 x i32>)
219 declare i8 @llvm.vector.reduce.umin.v32i8(<32 x i8>)