summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/rev.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-19 09:20:23 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-19 09:20:23 +0000
commit02b985c50faa7b0f43ef4100761c633ed4b8d6d2 (patch)
tree0d21bd626b6931c8fd248b5094331f5bb53f3b54 /test/CodeGen/ARM/rev.ll
parenta8e2989ece6dc46df59b0768184028257f913843 (diff)
downloadllvm-02b985c50faa7b0f43ef4100761c633ed4b8d6d2.tar.gz
llvm-02b985c50faa7b0f43ef4100761c633ed4b8d6d2.tar.bz2
llvm-02b985c50faa7b0f43ef4100761c633ed4b8d6d2.tar.xz
ARM test cases contributed by Apple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/rev.ll')
-rw-r--r--test/CodeGen/ARM/rev.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/rev.ll b/test/CodeGen/ARM/rev.ll
new file mode 100644
index 0000000000..fba519de02
--- /dev/null
+++ b/test/CodeGen/ARM/rev.ll
@@ -0,0 +1,30 @@
+; 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
+}
+