1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -verify-machineinstrs \
3 ; RUN: -aarch64-enable-atomic-cfg-tidy=0 -disable-cgp -disable-branch-fold \
4 ; RUN: < %s | FileCheck %s
7 ; Verify that we don't mess up vector comparisons in fast-isel.
10 define <2 x i32> @icmp_v2i32(<2 x i32> %a) {
11 ; CHECK-LABEL: icmp_v2i32:
13 ; CHECK-NEXT: cmeq.2s v0, v0, #0
14 ; CHECK-NEXT: ; %bb.1: ; %bb2
15 ; CHECK-NEXT: movi.2s v1, #1
16 ; CHECK-NEXT: and.8b v0, v0, v1
18 %c = icmp eq <2 x i32> %a, zeroinitializer
21 %z = zext <2 x i1> %c to <2 x i32>
25 define <2 x i32> @icmp_constfold_v2i32(<2 x i32> %a) {
26 ; CHECK-LABEL: icmp_constfold_v2i32:
28 ; CHECK-NEXT: movi.2s v0, #1
29 ; CHECK-NEXT: and.8b v0, v0, v0
31 %1 = icmp eq <2 x i32> %a, %a
34 %2 = zext <2 x i1> %1 to <2 x i32>
38 define <4 x i32> @icmp_v4i32(<4 x i32> %a) {
39 ; CHECK-LABEL: icmp_v4i32:
41 ; CHECK-NEXT: cmeq.4s v0, v0, #0
42 ; CHECK-NEXT: xtn.4h v0, v0
43 ; CHECK-NEXT: ; %bb.1: ; %bb2
44 ; CHECK-NEXT: movi.4h v1, #1
45 ; CHECK-NEXT: and.8b v0, v0, v1
46 ; CHECK-NEXT: ushll.4s v0, v0, #0
48 %c = icmp eq <4 x i32> %a, zeroinitializer
51 %z = zext <4 x i1> %c to <4 x i32>
55 define <4 x i32> @icmp_constfold_v4i32(<4 x i32> %a) {
56 ; CHECK-LABEL: icmp_constfold_v4i32:
58 ; CHECK-NEXT: movi.4h v0, #1
59 ; CHECK-NEXT: ; %bb.1: ; %bb2
60 ; CHECK-NEXT: and.8b v0, v0, v0
61 ; CHECK-NEXT: ushll.4s v0, v0, #0
63 %1 = icmp eq <4 x i32> %a, %a
66 %2 = zext <4 x i1> %1 to <4 x i32>
70 define <16 x i8> @icmp_v16i8(<16 x i8> %a) {
71 ; CHECK-LABEL: icmp_v16i8:
73 ; CHECK-NEXT: cmeq.16b v0, v0, #0
74 ; CHECK-NEXT: ; %bb.1: ; %bb2
75 ; CHECK-NEXT: movi.16b v1, #1
76 ; CHECK-NEXT: and.16b v0, v0, v1
78 %c = icmp eq <16 x i8> %a, zeroinitializer
81 %z = zext <16 x i1> %c to <16 x i8>
85 define <16 x i8> @icmp_constfold_v16i8(<16 x i8> %a) {
86 ; CHECK-LABEL: icmp_constfold_v16i8:
88 ; CHECK-NEXT: movi.16b v0, #1
90 %1 = icmp eq <16 x i8> %a, %a
93 %2 = zext <16 x i1> %1 to <16 x i8>