mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 00:11:00 +00:00
02b985c50f
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33354 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
1.5 KiB
LLVM
31 lines
1.5 KiB
LLVM
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | grep rev16 &&
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | grep revsh
|
|
|
|
int %test1(uint %X) {
|
|
%tmp1 = shr uint %X, ubyte 8 ; <uint> [#uses=1]
|
|
%tmp1 = cast uint %tmp1 to int ; <int> [#uses=2]
|
|
%X15 = cast uint %X to int ; <int> [#uses=1]
|
|
%tmp4 = shl int %X15, ubyte 8 ; <int> [#uses=2]
|
|
%tmp2 = and int %tmp1, 16711680 ; <int> [#uses=1]
|
|
%tmp5 = and int %tmp4, -16777216 ; <int> [#uses=1]
|
|
%tmp9 = and int %tmp1, 255 ; <int> [#uses=1]
|
|
%tmp13 = and int %tmp4, 65280 ; <int> [#uses=1]
|
|
%tmp6 = or int %tmp5, %tmp2 ; <int> [#uses=1]
|
|
%tmp10 = or int %tmp6, %tmp13 ; <int> [#uses=1]
|
|
%tmp14 = or int %tmp10, %tmp9 ; <int> [#uses=1]
|
|
ret int %tmp14
|
|
}
|
|
|
|
int %test2(uint %X) { ; revsh
|
|
%tmp1 = shr uint %X, ubyte 8 ; <uint> [#uses=1]
|
|
%tmp1 = cast uint %tmp1 to short ; <short> [#uses=1]
|
|
%tmp3 = cast uint %X to short ; <short> [#uses=1]
|
|
%tmp2 = and short %tmp1, 255 ; <short> [#uses=1]
|
|
%tmp4 = shl short %tmp3, ubyte 8 ; <short> [#uses=1]
|
|
%tmp5 = or short %tmp2, %tmp4 ; <short> [#uses=1]
|
|
%tmp5 = cast short %tmp5 to int ; <int> [#uses=1]
|
|
ret int %tmp5
|
|
}
|
|
|