summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2016-01-22 19:47:26 +0000
committerJingyue Wu <jingyue@google.com>2016-01-22 19:47:26 +0000
commit585ec8671dd5eb52ab0628611e550edd4ee532dc (patch)
tree05bec92f6830ae36ab92b098169f5fb406266d95 /llvm/test
parentd5607d35d4f170a8d95a61ef1ee4c37343df0e26 (diff)
downloadbcm5719-llvm-585ec8671dd5eb52ab0628611e550edd4ee532dc.tar.gz
bcm5719-llvm-585ec8671dd5eb52ab0628611e550edd4ee532dc.zip
[NVPTX] expand mul_lohi to mul_lo and mul_hi
Summary: Fixes PR26186. Reviewers: grosser, jholewinski Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D16479 llvm-svn: 258536
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/NVPTX/arithmetic-int.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/arithmetic-int.ll b/llvm/test/CodeGen/NVPTX/arithmetic-int.ll
index b5a2872299b..e7c968c4c0b 100644
--- a/llvm/test/CodeGen/NVPTX/arithmetic-int.ll
+++ b/llvm/test/CodeGen/NVPTX/arithmetic-int.ll
@@ -29,6 +29,30 @@ define i64 @mul_i64(i64 %a, i64 %b) {
ret i64 %ret
}
+define i64 @umul_lohi_i64(i64 %a) {
+; CHECK-LABEL: umul_lohi_i64(
+entry:
+ %0 = zext i64 %a to i128
+ %1 = mul i128 %0, 288
+; CHECK: mul.lo.{{u|s}}64
+; CHECK: mul.hi.{{u|s}}64
+ %2 = lshr i128 %1, 1
+ %3 = trunc i128 %2 to i64
+ ret i64 %3
+}
+
+define i64 @smul_lohi_i64(i64 %a) {
+; CHECK-LABEL: smul_lohi_i64(
+entry:
+ %0 = sext i64 %a to i128
+ %1 = mul i128 %0, 288
+; CHECK: mul.lo.{{u|s}}64
+; CHECK: mul.hi.{{u|s}}64
+ %2 = ashr i128 %1, 1
+ %3 = trunc i128 %2 to i64
+ ret i64 %3
+}
+
define i64 @sdiv_i64(i64 %a, i64 %b) {
; CHECK: div.s64 %rd{{[0-9]+}}, %rd{{[0-9]+}}, %rd{{[0-9]+}}
; CHECK: ret
OpenPOWER on IntegriCloud