1 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
2 target datalayout = "E-m:e-p:32:32-i64:64-n32"
3 target triple = "powerpc-unknown-linux-gnu"
5 ; Function Attrs: nounwind readnone
6 define zeroext i16 @test16(i16 zeroext %x, i16 zeroext %y) #0 {
10 %cmp = icmp eq i16 %1, 0
11 %cmp20 = icmp ult i16 %0, 256
12 %conv25 = select i1 %cmp, i32 255, i32 0
13 %conv27 = select i1 %cmp20, i32 65280, i32 0
14 %or = or i32 %conv25, %conv27
15 %conv29 = trunc i32 %or to i16
18 ; CHECK-LABEL: @test16
19 ; CHECK: cmpb [[REG1:[0-9]+]], 4, 3
20 ; CHECK: clrlwi 3, [[REG1]], 16
24 define i32 @test32(i32 %x, i32 %y) #0 {
28 %cmp = icmp eq i32 %1, 0
29 %2 = and i32 %0, 65280
30 %cmp28 = icmp eq i32 %2, 0
31 %3 = and i32 %0, 16711680
32 %cmp34 = icmp eq i32 %3, 0
33 %cmp40 = icmp ult i32 %0, 16777216
34 %conv44 = select i1 %cmp, i32 255, i32 0
35 %conv45 = select i1 %cmp28, i32 65280, i32 0
36 %conv47 = select i1 %cmp34, i32 16711680, i32 0
37 %conv50 = select i1 %cmp40, i32 -16777216, i32 0
38 %or = or i32 %conv45, %conv50
39 %or49 = or i32 %or, %conv44
40 %or52 = or i32 %or49, %conv47
43 ; CHECK-LABEL: @test32
49 attributes #0 = { nounwind readnone }