llvm-6502/test/CodeGen/ARM/pack.ll
Evan Cheng 02b985c50f ARM test cases contributed by Apple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33354 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 09:20:23 +00:00

78 lines
2.4 KiB
LLVM

; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | grep pkhbt | wc -l | grep 5 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | grep pkhtb | wc -l | grep 4
implementation ; Functions:
int %test1(int %X, int %Y) {
%tmp1 = and int %X, 65535 ; <int> [#uses=1]
%tmp4 = shl int %Y, ubyte 16 ; <int> [#uses=1]
%tmp5 = or int %tmp4, %tmp1 ; <int> [#uses=1]
ret int %tmp5
}
int %test1a(int %X, int %Y) {
%tmp19 = and int %X, 65535 ; <int> [#uses=1]
%tmp37 = shl int %Y, ubyte 16 ; <int> [#uses=1]
%tmp5 = or int %tmp37, %tmp19 ; <int> [#uses=1]
ret int %tmp5
}
int %test2(int %X, int %Y) {
%tmp1 = and int %X, 65535 ; <int> [#uses=1]
%tmp3 = shl int %Y, ubyte 12 ; <int> [#uses=1]
%tmp4 = and int %tmp3, -65536 ; <int> [#uses=1]
%tmp57 = or int %tmp4, %tmp1 ; <int> [#uses=1]
ret int %tmp57
}
int %test3(int %X, int %Y) {
%tmp19 = and int %X, 65535 ; <int> [#uses=1]
%tmp37 = shl int %Y, ubyte 18 ; <int> [#uses=1]
%tmp5 = or int %tmp37, %tmp19 ; <int> [#uses=1]
ret int %tmp5
}
int %test4(int %X, int %Y) {
%tmp1 = and int %X, 65535 ; <int> [#uses=1]
%tmp3 = and int %Y, -65536 ; <int> [#uses=1]
%tmp46 = or int %tmp3, %tmp1 ; <int> [#uses=1]
ret int %tmp46
}
int %test5(int %X, int %Y) {
%tmp17 = and int %X, -65536 ; <int> [#uses=1]
%tmp2 = cast int %Y to uint ; <uint> [#uses=1]
%tmp4 = shr uint %tmp2, ubyte 16 ; <uint> [#uses=1]
%tmp4 = cast uint %tmp4 to int ; <int> [#uses=1]
%tmp5 = or int %tmp4, %tmp17 ; <int> [#uses=1]
ret int %tmp5
}
int %test5a(int %X, int %Y) {
%tmp110 = and int %X, -65536 ; <int> [#uses=1]
%Y = cast int %Y to uint ; <uint> [#uses=1]
%tmp37 = shr uint %Y, ubyte 16 ; <uint> [#uses=1]
%tmp39 = cast uint %tmp37 to int ; <int> [#uses=1]
%tmp5 = or int %tmp39, %tmp110 ; <int> [#uses=1]
ret int %tmp5
}
int %test6(int %X, int %Y) {
%tmp1 = and int %X, -65536 ; <int> [#uses=1]
%Y = cast int %Y to uint ; <uint> [#uses=1]
%tmp37 = shr uint %Y, ubyte 12 ; <uint> [#uses=1]
%tmp38 = cast uint %tmp37 to int ; <int> [#uses=1]
%tmp4 = and int %tmp38, 65535 ; <int> [#uses=1]
%tmp59 = or int %tmp4, %tmp1 ; <int> [#uses=1]
ret int %tmp59
}
int %test7(int %X, int %Y) {
%tmp1 = and int %X, -65536 ; <int> [#uses=1]
%tmp3 = shr int %Y, ubyte 18 ; <int> [#uses=1]
%tmp4 = and int %tmp3, 65535 ; <int> [#uses=1]
%tmp57 = or int %tmp4, %tmp1 ; <int> [#uses=1]
ret int %tmp57
}