aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Thumb2/thumb2-mulhi.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-07-07 01:17:28 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-07-07 01:17:28 +0000
commit5b9fcd1c8e9f2b7964a82cd383441f568890b561 (patch)
tree325596d238d07269a232a57cad82a6d261f0a855 /test/CodeGen/Thumb2/thumb2-mulhi.ll
parent58541fd62707b6856beee3db9e254b0110607bb1 (diff)
downloadexternal_llvm-5b9fcd1c8e9f2b7964a82cd383441f568890b561.zip
external_llvm-5b9fcd1c8e9f2b7964a82cd383441f568890b561.tar.gz
external_llvm-5b9fcd1c8e9f2b7964a82cd383441f568890b561.tar.bz2
Add some more Thumb2 multiplication instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-mulhi.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-mulhi.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-mulhi.ll b/test/CodeGen/Thumb2/thumb2-mulhi.ll
new file mode 100644
index 0000000..7b41509
--- /dev/null
+++ b/test/CodeGen/Thumb2/thumb2-mulhi.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep smmul | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep umull | count 1
+
+define i32 @smulhi(i32 %x, i32 %y) {
+ %tmp = sext i32 %x to i64 ; <i64> [#uses=1]
+ %tmp1 = sext i32 %y to i64 ; <i64> [#uses=1]
+ %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
+ %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
+ %tmp3.upgrd.1 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
+ ret i32 %tmp3.upgrd.1
+}
+
+define i32 @umulhi(i32 %x, i32 %y) {
+ %tmp = zext i32 %x to i64 ; <i64> [#uses=1]
+ %tmp1 = zext i32 %y to i64 ; <i64> [#uses=1]
+ %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
+ %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
+ %tmp3.upgrd.2 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
+ ret i32 %tmp3.upgrd.2
+}