diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-06-13 16:21:57 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-06-13 16:21:57 +0000 |
commit | c83c267b84c2f9986fa67cd62e738da7d9a76137 (patch) | |
tree | 2a2855fe85790afdf4f40650b65164923421cec1 /llvm/test/CodeGen | |
parent | 7e9d2cb553fc7344d37b9659a40a38cb2a3d66b1 (diff) | |
download | bcm5719-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.ll | 27 |
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 +} |