1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s
5 define arm_aapcs_vfpcc <4 x i32> @build_true_v4i1(<4 x i32> %a, <4 x i32> %b) {
6 ; CHECK-LABEL: build_true_v4i1:
7 ; CHECK: @ %bb.0: @ %entry
10 %s = select <4 x i1> <i1 1, i1 1, i1 1, i1 1>, <4 x i32> %a, <4 x i32> %b
14 define arm_aapcs_vfpcc <4 x i32> @build_false_v4i1(<4 x i32> %a, <4 x i32> %b) {
15 ; CHECK-LABEL: build_false_v4i1:
16 ; CHECK: @ %bb.0: @ %entry
17 ; CHECK-NEXT: vmov q0, q1
20 %s = select <4 x i1> <i1 0, i1 0, i1 0, i1 0>, <4 x i32> %a, <4 x i32> %b
24 define arm_aapcs_vfpcc <4 x i32> @build_upper_v4i1(<4 x i32> %a, <4 x i32> %b) {
25 ; CHECK-LABEL: build_upper_v4i1:
26 ; CHECK: @ %bb.0: @ %entry
27 ; CHECK-NEXT: mov.w r0, #65280
28 ; CHECK-NEXT: vmsr p0, r0
29 ; CHECK-NEXT: vpsel q0, q0, q1
32 %s = select <4 x i1> <i1 0, i1 0, i1 1, i1 1>, <4 x i32> %a, <4 x i32> %b
36 define arm_aapcs_vfpcc <4 x i32> @build_lower_v4i1(<4 x i32> %a, <4 x i32> %b) {
37 ; CHECK-LABEL: build_lower_v4i1:
38 ; CHECK: @ %bb.0: @ %entry
39 ; CHECK-NEXT: movs r0, #255
40 ; CHECK-NEXT: vmsr p0, r0
41 ; CHECK-NEXT: vpsel q0, q0, q1
44 %s = select <4 x i1> <i1 1, i1 1, i1 0, i1 0>, <4 x i32> %a, <4 x i32> %b
49 define arm_aapcs_vfpcc <8 x i16> @build_true_v8i1(<8 x i16> %a, <8 x i16> %b) {
50 ; CHECK-LABEL: build_true_v8i1:
51 ; CHECK: @ %bb.0: @ %entry
54 %s = select <8 x i1> <i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1>, <8 x i16> %a, <8 x i16> %b
58 define arm_aapcs_vfpcc <8 x i16> @build_false_v8i1(<8 x i16> %a, <8 x i16> %b) {
59 ; CHECK-LABEL: build_false_v8i1:
60 ; CHECK: @ %bb.0: @ %entry
61 ; CHECK-NEXT: vmov q0, q1
64 %s = select <8 x i1> <i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0>, <8 x i16> %a, <8 x i16> %b
68 define arm_aapcs_vfpcc <8 x i16> @build_upper_v8i1(<8 x i16> %a, <8 x i16> %b) {
69 ; CHECK-LABEL: build_upper_v8i1:
70 ; CHECK: @ %bb.0: @ %entry
71 ; CHECK-NEXT: mov.w r0, #65280
72 ; CHECK-NEXT: vmsr p0, r0
73 ; CHECK-NEXT: vpsel q0, q0, q1
76 %s = select <8 x i1> <i1 0, i1 0, i1 0, i1 0, i1 1, i1 1, i1 1, i1 1>, <8 x i16> %a, <8 x i16> %b
80 define arm_aapcs_vfpcc <8 x i16> @build_lower_v8i1(<8 x i16> %a, <8 x i16> %b) {
81 ; CHECK-LABEL: build_lower_v8i1:
82 ; CHECK: @ %bb.0: @ %entry
83 ; CHECK-NEXT: movs r0, #255
84 ; CHECK-NEXT: vmsr p0, r0
85 ; CHECK-NEXT: vpsel q0, q0, q1
88 %s = select <8 x i1> <i1 1, i1 1, i1 1, i1 1, i1 0, i1 0, i1 0, i1 0>, <8 x i16> %a, <8 x i16> %b
93 define arm_aapcs_vfpcc <16 x i8> @build_true_v16i1(<16 x i8> %a, <16 x i8> %b) {
94 ; CHECK-LABEL: build_true_v16i1:
95 ; CHECK: @ %bb.0: @ %entry
98 %s = select <16 x i1> <i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1>, <16 x i8> %a, <16 x i8> %b
102 define arm_aapcs_vfpcc <16 x i8> @build_false_v16i1(<16 x i8> %a, <16 x i8> %b) {
103 ; CHECK-LABEL: build_false_v16i1:
104 ; CHECK: @ %bb.0: @ %entry
105 ; CHECK-NEXT: vmov q0, q1
108 %s = select <16 x i1> <i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0>, <16 x i8> %a, <16 x i8> %b
112 define arm_aapcs_vfpcc <16 x i8> @build_upper_v16i1(<16 x i8> %a, <16 x i8> %b) {
113 ; CHECK-LABEL: build_upper_v16i1:
114 ; CHECK: @ %bb.0: @ %entry
115 ; CHECK-NEXT: mov.w r0, #65280
116 ; CHECK-NEXT: vmsr p0, r0
117 ; CHECK-NEXT: vpsel q0, q0, q1
120 %s = select <16 x i1> <i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1>, <16 x i8> %a, <16 x i8> %b
124 define arm_aapcs_vfpcc <16 x i8> @build_lower_v16i1(<16 x i8> %a, <16 x i8> %b) {
125 ; CHECK-LABEL: build_lower_v16i1:
126 ; CHECK: @ %bb.0: @ %entry
127 ; CHECK-NEXT: movs r0, #255
128 ; CHECK-NEXT: vmsr p0, r0
129 ; CHECK-NEXT: vpsel q0, q0, q1
132 %s = select <16 x i1> <i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0>, <16 x i8> %a, <16 x i8> %b
137 define arm_aapcs_vfpcc <2 x i64> @build_true_v2i1(<2 x i64> %a, <2 x i64> %b) {
138 ; CHECK-LABEL: build_true_v2i1:
139 ; CHECK: @ %bb.0: @ %entry
142 %s = select <2 x i1> <i1 1, i1 1>, <2 x i64> %a, <2 x i64> %b
146 define arm_aapcs_vfpcc <2 x i64> @build_false_v2i1(<2 x i64> %a, <2 x i64> %b) {
147 ; CHECK-LABEL: build_false_v2i1:
148 ; CHECK: @ %bb.0: @ %entry
149 ; CHECK-NEXT: vmov q0, q1
152 %s = select <2 x i1> <i1 0, i1 0>, <2 x i64> %a, <2 x i64> %b
156 define arm_aapcs_vfpcc <2 x i64> @build_upper_v2i1(<2 x i64> %a, <2 x i64> %b) {
157 ; CHECK-LABEL: build_upper_v2i1:
158 ; CHECK: @ %bb.0: @ %entry
159 ; CHECK-NEXT: adr r0, .LCPI14_0
160 ; CHECK-NEXT: vldrw.u32 q2, [r0]
161 ; CHECK-NEXT: vbic q1, q1, q2
162 ; CHECK-NEXT: vand q0, q0, q2
163 ; CHECK-NEXT: vorr q0, q0, q1
165 ; CHECK-NEXT: .p2align 4
166 ; CHECK-NEXT: @ %bb.1:
167 ; CHECK-NEXT: .LCPI14_0:
168 ; CHECK-NEXT: .long 0 @ 0x0
169 ; CHECK-NEXT: .long 0 @ 0x0
170 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
171 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
173 %s = select <2 x i1> <i1 0, i1 1>, <2 x i64> %a, <2 x i64> %b
177 define arm_aapcs_vfpcc <2 x i64> @build_lower_v2i1(<2 x i64> %a, <2 x i64> %b) {
178 ; CHECK-LABEL: build_lower_v2i1:
179 ; CHECK: @ %bb.0: @ %entry
180 ; CHECK-NEXT: adr r0, .LCPI15_0
181 ; CHECK-NEXT: vldrw.u32 q2, [r0]
182 ; CHECK-NEXT: vbic q1, q1, q2
183 ; CHECK-NEXT: vand q0, q0, q2
184 ; CHECK-NEXT: vorr q0, q0, q1
186 ; CHECK-NEXT: .p2align 4
187 ; CHECK-NEXT: @ %bb.1:
188 ; CHECK-NEXT: .LCPI15_0:
189 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
190 ; CHECK-NEXT: .long 4294967295 @ 0xffffffff
191 ; CHECK-NEXT: .long 0 @ 0x0
192 ; CHECK-NEXT: .long 0 @ 0x0
194 %s = select <2 x i1> <i1 1, i1 0>, <2 x i64> %a, <2 x i64> %b