1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux-gnu -mcpu pwr7 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu pwr7 -vec-extabi < %s | FileCheck %s
5 ; Function Attrs: nounwind readnone
6 define zeroext i16 @test16(i16 zeroext %x, i16 zeroext %y) #0 {
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: cmpb 3, 4, 3
10 ; CHECK-NEXT: clrldi 3, 3, 48
15 %cmp = icmp eq i16 %1, 0
16 %cmp20 = icmp ult i16 %0, 256
17 %conv25 = select i1 %cmp, i32 255, i32 0
18 %conv27 = select i1 %cmp20, i32 65280, i32 0
19 %or = or i32 %conv25, %conv27
20 %conv29 = trunc i32 %or to i16
24 define zeroext i16 @test16p1(i16 zeroext %x, i16 zeroext %y) #0 {
25 ; CHECK-LABEL: test16p1:
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: cmpb 3, 4, 3
28 ; CHECK-NEXT: andi. 3, 3, 65285
33 %cmp = icmp eq i16 %1, 0
34 %cmp20 = icmp ult i16 %0, 256
35 %conv28 = select i1 %cmp, i32 5, i32 0
36 %conv30 = select i1 %cmp20, i32 65280, i32 0
37 %or = or i32 %conv28, %conv30
38 %conv32 = trunc i32 %or to i16
42 ; Function Attrs: nounwind readnone
43 define zeroext i16 @test16p2(i16 zeroext %x, i16 zeroext %y) #0 {
44 ; CHECK-LABEL: test16p2:
45 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: cmpb 3, 4, 3
47 ; CHECK-NEXT: andi. 3, 3, 1535
52 %cmp = icmp eq i16 %1, 0
53 %cmp20 = icmp ult i16 %0, 256
54 %conv28 = select i1 %cmp, i32 255, i32 0
55 %conv30 = select i1 %cmp20, i32 1280, i32 0
56 %or = or i32 %conv28, %conv30
57 %conv32 = trunc i32 %or to i16
61 ; Function Attrs: nounwind readnone
62 define zeroext i16 @test16p3(i16 zeroext %x, i16 zeroext %y) #0 {
63 ; CHECK-LABEL: test16p3:
64 ; CHECK: # %bb.0: # %entry
65 ; CHECK-NEXT: cmpb 3, 4, 3
66 ; CHECK-NEXT: clrldi 3, 3, 55
67 ; CHECK-NEXT: xori 3, 3, 1280
72 %cmp = icmp eq i16 %1, 0
73 %cmp20 = icmp ult i16 %0, 256
74 %conv27 = select i1 %cmp, i32 255, i32 0
75 %conv29 = select i1 %cmp20, i32 1024, i32 1280
76 %or = or i32 %conv27, %conv29
77 %conv31 = trunc i32 %or to i16
81 define zeroext i32 @test32(i32 zeroext %x, i32 zeroext %y) #0 {
82 ; CHECK-LABEL: test32:
83 ; CHECK: # %bb.0: # %entry
84 ; CHECK-NEXT: cmpb 3, 4, 3
85 ; CHECK-NEXT: clrldi 3, 3, 32
90 %cmp = icmp eq i32 %1, 0
91 %2 = and i32 %0, 65280
92 %cmp28 = icmp eq i32 %2, 0
93 %3 = and i32 %0, 16711680
94 %cmp34 = icmp eq i32 %3, 0
95 %cmp40 = icmp ult i32 %0, 16777216
96 %conv44 = select i1 %cmp, i32 255, i32 0
97 %conv45 = select i1 %cmp28, i32 65280, i32 0
98 %conv47 = select i1 %cmp34, i32 16711680, i32 0
99 %conv50 = select i1 %cmp40, i32 -16777216, i32 0
100 %or = or i32 %conv45, %conv50
101 %or49 = or i32 %or, %conv44
102 %or52 = or i32 %or49, %conv47
106 define zeroext i32 @test32p1(i32 zeroext %x, i32 zeroext %y) #0 {
107 ; CHECK-LABEL: test32p1:
108 ; CHECK: # %bb.0: # %entry
109 ; CHECK-NEXT: cmpb 3, 4, 3
110 ; CHECK-NEXT: rldicl 3, 3, 40, 5
111 ; CHECK-NEXT: rldicl 3, 3, 24, 32
116 %cmp = icmp eq i32 %1, 0
117 %2 = and i32 %0, 65280
118 %cmp28 = icmp eq i32 %2, 0
119 %3 = and i32 %0, 16711680
120 %cmp34 = icmp eq i32 %3, 0
121 %cmp40 = icmp ult i32 %0, 16777216
122 %conv47 = select i1 %cmp, i32 255, i32 0
123 %conv48 = select i1 %cmp28, i32 65280, i32 0
124 %conv50 = select i1 %cmp34, i32 458752, i32 0
125 %conv53 = select i1 %cmp40, i32 -16777216, i32 0
126 %or = or i32 %conv48, %conv53
127 %or52 = or i32 %or, %conv47
128 %or55 = or i32 %or52, %conv50
132 define zeroext i32 @test32p2(i32 zeroext %x, i32 zeroext %y) #0 {
133 ; CHECK-LABEL: test32p2:
134 ; CHECK: # %bb.0: # %entry
135 ; CHECK-NEXT: cmpb 3, 4, 3
136 ; CHECK-NEXT: rldicl 3, 3, 40, 8
137 ; CHECK-NEXT: rldicl 3, 3, 24, 32
142 %cmp = icmp eq i32 %1, 0
143 %2 = and i32 %0, 65280
144 %cmp22 = icmp eq i32 %2, 0
145 %cmp28 = icmp ult i32 %0, 16777216
146 %conv32 = select i1 %cmp, i32 255, i32 0
147 %conv33 = select i1 %cmp22, i32 65280, i32 0
148 %conv35 = select i1 %cmp28, i32 -16777216, i32 0
149 %or = or i32 %conv33, %conv35
150 %or37 = or i32 %or, %conv32
154 define i64 @test64(i64 %x, i64 %y) #0 {
155 ; CHECK-LABEL: test64:
156 ; CHECK: # %bb.0: # %entry
157 ; CHECK-NEXT: cmpb 3, 3, 4
160 %shr19 = lshr i64 %x, 56
161 %conv21 = trunc i64 %shr19 to i32
162 %shr43 = lshr i64 %y, 56
163 %conv45 = trunc i64 %shr43 to i32
166 %cmp = icmp eq i64 %1, 0
167 %2 = and i64 %0, 65280
168 %cmp52 = icmp eq i64 %2, 0
169 %3 = and i64 %0, 16711680
170 %cmp58 = icmp eq i64 %3, 0
171 %4 = and i64 %0, 4278190080
172 %cmp64 = icmp eq i64 %4, 0
173 %5 = and i64 %0, 1095216660480
174 %cmp70 = icmp eq i64 %5, 0
175 %6 = and i64 %0, 280375465082880
176 %cmp76 = icmp eq i64 %6, 0
177 %7 = and i64 %0, 71776119061217280
178 %cmp82 = icmp eq i64 %7, 0
179 %cmp88 = icmp eq i32 %conv21, %conv45
180 %conv92 = select i1 %cmp, i64 255, i64 0
181 %conv93 = select i1 %cmp52, i64 65280, i64 0
182 %or = or i64 %conv92, %conv93
183 %conv95 = select i1 %cmp58, i64 16711680, i64 0
184 %or97 = or i64 %or, %conv95
185 %conv98 = select i1 %cmp64, i64 4278190080, i64 0
186 %or100 = or i64 %or97, %conv98
187 %conv101 = select i1 %cmp70, i64 1095216660480, i64 0
188 %or103 = or i64 %or100, %conv101
189 %conv104 = select i1 %cmp76, i64 280375465082880, i64 0
190 %or106 = or i64 %or103, %conv104
191 %conv107 = select i1 %cmp82, i64 71776119061217280, i64 0
192 %or109 = or i64 %or106, %conv107
193 %conv110 = select i1 %cmp88, i64 -72057594037927936, i64 0
194 %or112 = or i64 %or109, %conv110
198 attributes #0 = { nounwind readnone }