summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-06-13 16:21:57 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-06-13 16:21:57 +0000
commitc83c267b84c2f9986fa67cd62e738da7d9a76137 (patch)
tree2a2855fe85790afdf4f40650b65164923421cec1 /llvm/test/CodeGen
parent7e9d2cb553fc7344d37b9659a40a38cb2a3d66b1 (diff)
downloadbcm5719-llvm-c83c267b84c2f9986fa67cd62e738da7d9a76137.tar.gz
bcm5719-llvm-c83c267b84c2f9986fa67cd62e738da7d9a76137.zip
[Hexagon] Generate multiply-high instruction in isel
llvm-svn: 305302
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/Hexagon/mulh.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Hexagon/mulh.ll b/llvm/test/CodeGen/Hexagon/mulh.ll
new file mode 100644
index 00000000000..0442e28d408
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/mulh.ll
@@ -0,0 +1,27 @@
+; RUN: llc -march=hexagon < %s | FileCheck %s
+
+target triple = "hexagon"
+
+; CHECK-LABEL: danny:
+; CHECK: r{{[0-9]+}} = mpy(r0,r1)
+define i32 @danny(i32 %a0, i32 %a1) {
+b2:
+ %v3 = sext i32 %a0 to i64
+ %v4 = sext i32 %a1 to i64
+ %v5 = mul nsw i64 %v3, %v4
+ %v6 = ashr i64 %v5, 32
+ %v7 = trunc i64 %v6 to i32
+ ret i32 %v7
+}
+
+; CHECK-LABEL: sammy:
+; CHECK: r{{[0-9]+}} = mpy(r0,r1)
+define i32 @sammy(i32 %a0, i32 %a1) {
+b2:
+ %v3 = sext i32 %a0 to i64
+ %v4 = sext i32 %a1 to i64
+ %v5 = mul nsw i64 %v3, %v4
+ %v6 = lshr i64 %v5, 32
+ %v7 = trunc i64 %v6 to i32
+ ret i32 %v7
+}
OpenPOWER on IntegriCloud