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