mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-31 09:11:13 +00:00
d3b1f6d3e0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36091 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
688 B
Plaintext
32 lines
688 B
Plaintext
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
|
|
; RUN: grep {sh\[lr\]d} | wc -l | grep 5
|
|
|
|
long %test1(long %X, ubyte %C) {
|
|
%Y = shl long %X, ubyte %C
|
|
ret long %Y
|
|
}
|
|
long %test2(long %X, ubyte %C) {
|
|
%Y = shr long %X, ubyte %C
|
|
ret long %Y
|
|
}
|
|
ulong %test3(ulong %X, ubyte %C) {
|
|
%Y = shr ulong %X, ubyte %C
|
|
ret ulong %Y
|
|
}
|
|
|
|
uint %test4(uint %A, uint %B, ubyte %C) {
|
|
%X = shl uint %A, ubyte %C
|
|
%Cv = sub ubyte 32, %C
|
|
%Y = shr uint %B, ubyte %Cv
|
|
%Z = or uint %Y, %X
|
|
ret uint %Z
|
|
}
|
|
|
|
ushort %test5(ushort %A, ushort %B, ubyte %C) {
|
|
%X = shl ushort %A, ubyte %C
|
|
%Cv = sub ubyte 16, %C
|
|
%Y = shr ushort %B, ubyte %Cv
|
|
%Z = or ushort %Y, %X
|
|
ret ushort %Z
|
|
}
|