1 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep or &&
2 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 &&
3 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 2
5 implementation ; Functions:
7 int %rotlw(uint %x, int %sh) {
9 %tmp.3 = cast int %sh to ubyte ; <ubyte> [#uses=1]
10 %x = cast uint %x to int ; <int> [#uses=1]
11 %tmp.7 = sub int 32, %sh ; <int> [#uses=1]
12 %tmp.9 = cast int %tmp.7 to ubyte ; <ubyte> [#uses=1]
13 %tmp.10 = shr uint %x, ubyte %tmp.9 ; <uint> [#uses=1]
14 %tmp.4 = shl int %x, ubyte %tmp.3 ; <int> [#uses=1]
15 %tmp.10 = cast uint %tmp.10 to int ; <int> [#uses=1]
16 %tmp.12 = or int %tmp.10, %tmp.4 ; <int> [#uses=1]
20 int %rotrw(uint %x, int %sh) {
22 %tmp.3 = cast int %sh to ubyte ; <ubyte> [#uses=1]
23 %tmp.4 = shr uint %x, ubyte %tmp.3 ; <uint> [#uses=1]
24 %tmp.7 = sub int 32, %sh ; <int> [#uses=1]
25 %tmp.9 = cast int %tmp.7 to ubyte ; <ubyte> [#uses=1]
26 %x = cast uint %x to int ; <int> [#uses=1]
27 %tmp.4 = cast uint %tmp.4 to int ; <int> [#uses=1]
28 %tmp.10 = shl int %x, ubyte %tmp.9 ; <int> [#uses=1]
29 %tmp.12 = or int %tmp.4, %tmp.10 ; <int> [#uses=1]
33 int %rotlwi(uint %x) {
35 %x = cast uint %x to int ; <int> [#uses=1]
36 %tmp.7 = shr uint %x, ubyte 27 ; <uint> [#uses=1]
37 %tmp.3 = shl int %x, ubyte 5 ; <int> [#uses=1]
38 %tmp.7 = cast uint %tmp.7 to int ; <int> [#uses=1]
39 %tmp.9 = or int %tmp.3, %tmp.7 ; <int> [#uses=1]
43 int %rotrwi(uint %x) {
45 %tmp.3 = shr uint %x, ubyte 5 ; <uint> [#uses=1]
46 %x = cast uint %x to int ; <int> [#uses=1]
47 %tmp.3 = cast uint %tmp.3 to int ; <int> [#uses=1]
48 %tmp.7 = shl int %x, ubyte 27 ; <int> [#uses=1]
49 %tmp.9 = or int %tmp.3, %tmp.7 ; <int> [#uses=1]