1 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 define i32 @test1() #0 {
7 %conv67.reload = load i32, ptr undef
8 %const = bitcast i32 65535 to i32
12 %shl161 = shl nuw nsw i32 %conv67.reload, 15
13 %0 = load i8, ptr undef, align 1
14 %conv169 = zext i8 %0 to i32
15 %shl170 = shl nuw nsw i32 %conv169, 7
16 %const_mat = add i32 %const, -32767
17 %shl161.masked = and i32 %shl161, %const_mat
18 %conv174 = or i32 %shl170, %shl161.masked
22 ; CHECK-NOT: rlwimi 3, {{[0-9]+}}, 15, 0, 16
26 define i32 @test2() #0 {
28 %conv67.reload = load i32, ptr undef
29 %const = bitcast i32 65535 to i32
33 %shl161 = shl nuw nsw i32 %conv67.reload, 15
34 %0 = load i8, ptr undef, align 1
35 %conv169 = zext i8 %0 to i32
36 %shl170 = shl nuw nsw i32 %conv169, 7
37 %shl161.masked = and i32 %shl161, 32768
38 %conv174 = or i32 %shl170, %shl161.masked
42 ; CHECK: rlwinm 3, {{[0-9]+}}, 7, 17, 24
43 ; CHECK: rlwimi 3, {{[0-9]+}}, 15, 16, 16
47 attributes #0 = { nounwind }