1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple=powerpc-aix- < %s | \
4 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple=powerpc64le-- < %s | \
5 ; RUN: FileCheck %s --check-prefix=CHECK_LE
6 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-- < %s | \
7 ; RUN: FileCheck %s --check-prefix=CHECK_P8LE
8 define i1 @shufeq(<2 x i64> %a) #0 {
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: xxswapd 35, 34
12 ; CHECK-NEXT: lwz 3, L..C0(2) # %const.0
13 ; CHECK-NEXT: vcmpequw 2, 2, 3
14 ; CHECK-NEXT: lxvw4x 35, 0, 3
15 ; CHECK-NEXT: addi 3, 1, -16
16 ; CHECK-NEXT: vperm 3, 2, 2, 3
17 ; CHECK-NEXT: xxland 0, 35, 34
18 ; CHECK-NEXT: stxvw4x 0, 0, 3
19 ; CHECK-NEXT: lwz 3, -12(1)
22 ; CHECK_LE-LABEL: shufeq:
23 ; CHECK_LE: # %bb.0: # %entry
24 ; CHECK_LE-NEXT: xxswapd 35, 34
25 ; CHECK_LE-NEXT: addis 3, 2, .LCPI0_0@toc@ha
26 ; CHECK_LE-NEXT: addi 3, 3, .LCPI0_0@toc@l
27 ; CHECK_LE-NEXT: lxvd2x 0, 0, 3
28 ; CHECK_LE-NEXT: addi 3, 1, -16
29 ; CHECK_LE-NEXT: vcmpequw 2, 2, 3
30 ; CHECK_LE-NEXT: xxswapd 35, 0
31 ; CHECK_LE-NEXT: vperm 3, 2, 2, 3
32 ; CHECK_LE-NEXT: xxland 0, 35, 34
33 ; CHECK_LE-NEXT: xxswapd 0, 0
34 ; CHECK_LE-NEXT: stxvd2x 0, 0, 3
35 ; CHECK_LE-NEXT: ld 3, -16(1)
38 ; CHECK_P8LE-LABEL: shufeq:
39 ; CHECK_P8LE: # %bb.0: # %entry
40 ; CHECK_P8LE-NEXT: xxswapd 35, 34
41 ; CHECK_P8LE-NEXT: vcmpequd 2, 2, 3
42 ; CHECK_P8LE-NEXT: xxswapd 0, 34
43 ; CHECK_P8LE-NEXT: mffprd 3, 0
44 ; CHECK_P8LE-NEXT: blr
46 %0 = shufflevector <2 x i64> %a, <2 x i64> poison, <2 x i32> <i32 1, i32 undef>
47 %1 = icmp eq <2 x i64> %a, %0
48 %2 = extractelement <2 x i1> %1, i32 0
52 define i1 @shufne(<2 x i64> %a) #0 {
53 ; CHECK-LABEL: shufne:
54 ; CHECK: # %bb.0: # %entry
55 ; CHECK-NEXT: xxswapd 35, 34
56 ; CHECK-NEXT: lwz 3, L..C1(2) # %const.0
57 ; CHECK-NEXT: vcmpequw 2, 2, 3
58 ; CHECK-NEXT: lxvw4x 35, 0, 3
59 ; CHECK-NEXT: addi 3, 1, -16
60 ; CHECK-NEXT: vperm 3, 2, 2, 3
61 ; CHECK-NEXT: xxland 0, 35, 34
62 ; CHECK-NEXT: stxvw4x 0, 0, 3
63 ; CHECK-NEXT: lwz 3, -12(1)
66 ; CHECK_LE-LABEL: shufne:
67 ; CHECK_LE: # %bb.0: # %entry
68 ; CHECK_LE-NEXT: xxswapd 35, 34
69 ; CHECK_LE-NEXT: addis 3, 2, .LCPI1_0@toc@ha
70 ; CHECK_LE-NEXT: addi 3, 3, .LCPI1_0@toc@l
71 ; CHECK_LE-NEXT: lxvd2x 0, 0, 3
72 ; CHECK_LE-NEXT: addi 3, 1, -16
73 ; CHECK_LE-NEXT: vcmpequw 2, 2, 3
74 ; CHECK_LE-NEXT: xxswapd 35, 0
75 ; CHECK_LE-NEXT: vperm 3, 2, 2, 3
76 ; CHECK_LE-NEXT: xxland 0, 35, 34
77 ; CHECK_LE-NEXT: xxswapd 0, 0
78 ; CHECK_LE-NEXT: stxvd2x 0, 0, 3
79 ; CHECK_LE-NEXT: ld 3, -16(1)
82 ; CHECK_P8LE-LABEL: shufne:
83 ; CHECK_P8LE: # %bb.0: # %entry
84 ; CHECK_P8LE-NEXT: xxswapd 35, 34
85 ; CHECK_P8LE-NEXT: vcmpequd 2, 2, 3
86 ; CHECK_P8LE-NEXT: xxswapd 0, 34
87 ; CHECK_P8LE-NEXT: mffprd 3, 0
88 ; CHECK_P8LE-NEXT: blr
90 %0 = shufflevector <2 x i64> %a, <2 x i64> poison, <2 x i32> <i32 1, i32 undef>
91 %1 = icmp eq <2 x i64> %a, %0
92 %2 = extractelement <2 x i1> %1, i32 0
96 define <2 x i64> @cmpeq(<2 x i64> noundef %a, <2 x i64> noundef %b) {
98 ; CHECK: # %bb.0: # %entry
99 ; CHECK-NEXT: lwz 3, L..C2(2) # %const.0
100 ; CHECK-NEXT: vcmpequw 2, 2, 3
101 ; CHECK-NEXT: lxvw4x 35, 0, 3
102 ; CHECK-NEXT: vperm 3, 2, 2, 3
103 ; CHECK-NEXT: xxland 34, 35, 34
106 ; CHECK_LE-LABEL: cmpeq:
107 ; CHECK_LE: # %bb.0: # %entry
108 ; CHECK_LE-NEXT: addis 3, 2, .LCPI2_0@toc@ha
109 ; CHECK_LE-NEXT: vcmpequw 2, 2, 3
110 ; CHECK_LE-NEXT: addi 3, 3, .LCPI2_0@toc@l
111 ; CHECK_LE-NEXT: lxvd2x 0, 0, 3
112 ; CHECK_LE-NEXT: xxswapd 35, 0
113 ; CHECK_LE-NEXT: vperm 3, 2, 2, 3
114 ; CHECK_LE-NEXT: xxland 34, 35, 34
117 ; CHECK_P8LE-LABEL: cmpeq:
118 ; CHECK_P8LE: # %bb.0: # %entry
119 ; CHECK_P8LE-NEXT: vcmpequd 2, 2, 3
120 ; CHECK_P8LE-NEXT: blr
122 %cmp = icmp eq <2 x i64> %a, %b
123 %sext = sext <2 x i1> %cmp to <2 x i64>
127 define <2 x i64> @cmpne(<2 x i64> noundef %a, <2 x i64> noundef %b) {
128 ; CHECK-LABEL: cmpne:
129 ; CHECK: # %bb.0: # %entry
130 ; CHECK-NEXT: vcmpequw 2, 2, 3
131 ; CHECK-NEXT: lwz 3, L..C3(2) # %const.0
132 ; CHECK-NEXT: lxvw4x 35, 0, 3
133 ; CHECK-NEXT: xxlnor 34, 34, 34
134 ; CHECK-NEXT: vperm 3, 2, 2, 3
135 ; CHECK-NEXT: xxlor 34, 35, 34
138 ; CHECK_LE-LABEL: cmpne:
139 ; CHECK_LE: # %bb.0: # %entry
140 ; CHECK_LE-NEXT: addis 3, 2, .LCPI3_0@toc@ha
141 ; CHECK_LE-NEXT: vcmpequw 2, 2, 3
142 ; CHECK_LE-NEXT: addi 3, 3, .LCPI3_0@toc@l
143 ; CHECK_LE-NEXT: lxvd2x 0, 0, 3
144 ; CHECK_LE-NEXT: xxswapd 35, 0
145 ; CHECK_LE-NEXT: xxlnor 34, 34, 34
146 ; CHECK_LE-NEXT: vperm 3, 2, 2, 3
147 ; CHECK_LE-NEXT: xxlor 34, 35, 34
150 ; CHECK_P8LE-LABEL: cmpne:
151 ; CHECK_P8LE: # %bb.0: # %entry
152 ; CHECK_P8LE-NEXT: vcmpequd 2, 2, 3
153 ; CHECK_P8LE-NEXT: xxlnor 34, 34, 34
154 ; CHECK_P8LE-NEXT: blr
156 %cmp = icmp ne <2 x i64> %a, %b
157 %sext = sext <2 x i1> %cmp to <2 x i64>