1 ; RUN: llc < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-unknown-linux-gnu"
5 define i1 @and_cmp_variable_power_of_two(i32 %x, i32 %y) {
7 %and = and i32 %x, %shl
8 %cmp = icmp eq i32 %and, %shl
11 ; CHECK-LABEL: @and_cmp_variable_power_of_two
12 ; CHECK: subfic 4, 4, 32
13 ; CHECK: rlwnm 3, 3, 4, 31, 31
17 define i1 @and_cmp_variable_power_of_two_64(i64 %x, i64 %y) {
19 %and = and i64 %x, %shl
20 %cmp = icmp eq i64 %and, %shl
23 ; CHECK-LABEL: @and_cmp_variable_power_of_two_64
24 ; CHECK: subfic 4, 4, 64
25 ; CHECK: rldcl 3, 3, 4, 63
29 define i1 @and_ncmp_variable_power_of_two(i32 %x, i32 %y) {
31 %and = and i32 %x, %shl
32 %cmp = icmp ne i32 %and, %shl
35 ; CHECK-LABEL: @and_ncmp_variable_power_of_two
36 ; CHECK-DAG: subfic 4, 4, 32
37 ; CHECK-DAG: nor [[REG:[0-9]+]], 3, 3
38 ; CHECK: rlwnm 3, [[REG]], 4, 31, 31
42 define i1 @and_ncmp_variable_power_of_two_64(i64 %x, i64 %y) {
44 %and = and i64 %x, %shl
45 %cmp = icmp ne i64 %and, %shl
48 ; CHECK-LABEL: @and_ncmp_variable_power_of_two_64
49 ; CHECK-DAG: subfic 4, 4, 64
50 ; CHECK-DAG: not [[REG:[0-9]+]], 3
51 ; CHECK: rldcl 3, [[REG]], 4, 63