blob: e2045feb92096cf0c91ef4f51d2d8c2346856e58 [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep or &&
2; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 &&
3; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwinm | wc -l | grep 2
Nate Begemancfde3c12006-01-11 22:58:12 +00004
5implementation ; Functions:
6
7int %rotlw(uint %x, int %sh) {
8entry:
9 %tmp.3 = cast int %sh to ubyte ; <ubyte> [#uses=1]
Reid Spencereacb7022006-12-31 06:02:00 +000010 %x.s = cast uint %x to int ; <int> [#uses=1]
Nate Begemancfde3c12006-01-11 22:58:12 +000011 %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]
Reid Spencereacb7022006-12-31 06:02:00 +000014 %tmp.4 = shl int %x.s, ubyte %tmp.3 ; <int> [#uses=1]
Nate Begemancfde3c12006-01-11 22:58:12 +000015 %tmp.12 = or int %tmp.10, %tmp.4 ; <int> [#uses=1]
16 ret int %tmp.12
17}
18
19int %rotrw(uint %x, int %sh) {
20entry:
21 %tmp.3 = cast int %sh to ubyte ; <ubyte> [#uses=1]
22 %tmp.4 = shr uint %x, ubyte %tmp.3 ; <uint> [#uses=1]
23 %tmp.7 = sub int 32, %sh ; <int> [#uses=1]
24 %tmp.9 = cast int %tmp.7 to ubyte ; <ubyte> [#uses=1]
Reid Spencereacb7022006-12-31 06:02:00 +000025 %x.s = cast uint %x to int ; <int> [#uses=1]
26 %tmp.10 = shl int %x.s, ubyte %tmp.9 ; <int> [#uses=1]
Nate Begemancfde3c12006-01-11 22:58:12 +000027 %tmp.12 = or int %tmp.4, %tmp.10 ; <int> [#uses=1]
28 ret int %tmp.12
29}
30
31int %rotlwi(uint %x) {
32entry:
Reid Spencereacb7022006-12-31 06:02:00 +000033 %x.s = cast uint %x to int ; <int> [#uses=1]
Nate Begemancfde3c12006-01-11 22:58:12 +000034 %tmp.7 = shr uint %x, ubyte 27 ; <uint> [#uses=1]
Reid Spencereacb7022006-12-31 06:02:00 +000035 %tmp.3 = shl int %x.s, ubyte 5 ; <int> [#uses=1]
Nate Begemancfde3c12006-01-11 22:58:12 +000036 %tmp.9 = or int %tmp.3, %tmp.7 ; <int> [#uses=1]
37 ret int %tmp.9
38}
39
40int %rotrwi(uint %x) {
41entry:
42 %tmp.3 = shr uint %x, ubyte 5 ; <uint> [#uses=1]
Reid Spencereacb7022006-12-31 06:02:00 +000043 %x.s = cast uint %x to int ; <int> [#uses=1]
44 %tmp.7 = shl int %x.s, ubyte 27 ; <int> [#uses=1]
Nate Begemancfde3c12006-01-11 22:58:12 +000045 %tmp.9 = or int %tmp.3, %tmp.7 ; <int> [#uses=1]
46 ret int %tmp.9
47}