aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Thumb2/thumb2-rev.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-08-18 05:43:23 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-08-18 05:43:23 +0000
commit51f39961c3558ee71b6323d3713e9ddd2354e099 (patch)
treeeea70023dd9e8f1cecac4d610784bcee729af243 /test/CodeGen/Thumb2/thumb2-rev.ll
parent79e6408ad36be39c1c4d34e7e6d785d91e4f2c66 (diff)
downloadexternal_llvm-51f39961c3558ee71b6323d3713e9ddd2354e099.zip
external_llvm-51f39961c3558ee71b6323d3713e9ddd2354e099.tar.gz
external_llvm-51f39961c3558ee71b6323d3713e9ddd2354e099.tar.bz2
Fix revsh pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-rev.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-rev.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-rev.ll b/test/CodeGen/Thumb2/thumb2-rev.ll
index c1bdc38..4205ed1 100644
--- a/test/CodeGen/Thumb2/thumb2-rev.ll
+++ b/test/CodeGen/Thumb2/thumb2-rev.ll
@@ -8,3 +8,16 @@ define i32 @f1(i32 %a) {
}
declare i32 @llvm.bswap.i32(i32) nounwind readnone
+
+define i32 @f2(i32 %X) {
+; CHECK: f2:
+; CHECK: revsh r0, r0
+ %tmp1 = lshr i32 %X, 8
+ %tmp1.upgrd.1 = trunc i32 %tmp1 to i16
+ %tmp3 = trunc i32 %X to i16
+ %tmp2 = and i16 %tmp1.upgrd.1, 255
+ %tmp4 = shl i16 %tmp3, 8
+ %tmp5 = or i16 %tmp2, %tmp4
+ %tmp5.upgrd.2 = sext i16 %tmp5 to i32
+ ret i32 %tmp5.upgrd.2
+}