blob: 46cff2d2872a0bf41e22b3312e14a8be6479df72 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
Dan Gohman8c89a502007-08-15 13:36:28 +00002; RUN: grep {sh\[lr\]d} | count 5
Dan Gohmanf17a25c2007-07-18 16:29:46 +00003
4long %test1(long %X, ubyte %C) {
5 %Y = shl long %X, ubyte %C
6 ret long %Y
7}
8long %test2(long %X, ubyte %C) {
9 %Y = shr long %X, ubyte %C
10 ret long %Y
11}
12ulong %test3(ulong %X, ubyte %C) {
13 %Y = shr ulong %X, ubyte %C
14 ret ulong %Y
15}
16
17uint %test4(uint %A, uint %B, ubyte %C) {
18 %X = shl uint %A, ubyte %C
19 %Cv = sub ubyte 32, %C
20 %Y = shr uint %B, ubyte %Cv
21 %Z = or uint %Y, %X
22 ret uint %Z
23}
24
25ushort %test5(ushort %A, ushort %B, ubyte %C) {
26 %X = shl ushort %A, ubyte %C
27 %Cv = sub ubyte 16, %C
28 %Y = shr ushort %B, ubyte %Cv
29 %Z = or ushort %Y, %X
30 ret ushort %Z
31}