aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-07-08 16:15:06 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-07-08 16:15:06 +0000
commita928f27d2397238dbe7849d099d5b58952d99b40 (patch)
treeb71d19990068010d9c70b475b47c5987cd42084c
parenta565f7a4988848fceab7480ae87f6c54f06b8271 (diff)
downloadexternal_llvm-a928f27d2397238dbe7849d099d5b58952d99b40.zip
external_llvm-a928f27d2397238dbe7849d099d5b58952d99b40.tar.gz
external_llvm-a928f27d2397238dbe7849d099d5b58952d99b40.tar.bz2
Add rev16 test... xfail for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75012 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/Thumb2/thumb2-rev16.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-rev16.ll b/test/CodeGen/Thumb2/thumb2-rev16.ll
new file mode 100644
index 0000000..d45d1ff
--- /dev/null
+++ b/test/CodeGen/Thumb2/thumb2-rev16.ll
@@ -0,0 +1,32 @@
+; XFAIL: *
+; fixme rev16 pattern is not matching
+
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rev16\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
+
+; 0xff00ff00 = 4278255360
+; 0x00ff00ff = 16711935
+define i32 @f1(i32 %a) {
+ %l8 = shl i32 %a, 8
+ %r8 = lshr i32 %a, 8
+ %mask_l8 = and i32 %l8, 4278255360
+ %mask_r8 = and i32 %r8, 16711935
+ %tmp = or i32 %mask_l8, %mask_r8
+ ret i32 %tmp
+}
+
+; 0xff000000 = 4278190080
+; 0x00ff0000 = 16711680
+; 0x0000ff00 = 65280
+; 0x000000ff = 255
+define i32 @f2(i32 %a) {
+ %l8 = shl i32 %a, 8
+ %r8 = lshr i32 %a, 8
+ %masklo_l8 = and i32 %l8, 65280
+ %maskhi_l8 = and i32 %l8, 4278190080
+ %masklo_r8 = and i32 %r8, 255
+ %maskhi_r8 = and i32 %r8, 16711680
+ %tmp1 = or i32 %masklo_l8, %masklo_r8
+ %tmp2 = or i32 %maskhi_l8, %maskhi_r8
+ %tmp = or i32 %tmp1, %tmp2
+ ret i32 %tmp
+}