Debian Codegraph @

llvm/test/CodeGen/PowerPC/fast-isel-shifter.ll

raw
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=PPC64
2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-ibm-aix-xcoff -mcpu=pwr7 | FileCheck %s --check-prefix=PPC64
3
4 define i32 @shl() nounwind {
5 entry:
6 ; PPC64: shl
7 ; PPC64: slw
8 %shl = shl i32 -1, 2
9 ret i32 %shl
10 }
11
12 define i32 @shl_reg(i32 %src1, i32 %src2) nounwind {
13 entry:
14 ; PPC64: shl_reg
15 ; PPC64: slw
16 %shl = shl i32 %src1, %src2
17 ret i32 %shl
18 }
19
20 define i32 @lshr() nounwind {
21 entry:
22 ; PPC64: lshr
23 ; PPC64: srw
24 %lshr = lshr i32 -1, 2
25 ret i32 %lshr
26 }
27
28 define i32 @lshr_reg(i32 %src1, i32 %src2) nounwind {
29 entry:
30 ; PPC64: lshr_reg
31 ; PPC64: srw
32 %lshr = lshr i32 %src1, %src2
33 ret i32 %lshr
34 }
35
36 define i32 @ashr() nounwind {
37 entry:
38 ; PPC64: ashr
39 ; PPC64: srawi
40 %ashr = ashr i32 -1, 2
41 ret i32 %ashr
42 }
43
44 define i32 @ashr_reg(i32 %src1, i32 %src2) nounwind {
45 entry:
46 ; PPC64: ashr_reg
47 ; PPC64: sraw
48 %ashr = ashr i32 %src1, %src2
49 ret i32 %ashr
50 }
51