diff options
author | Richard Osborne <richard@xmos.com> | 2010-03-10 13:20:07 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2010-03-10 13:20:07 +0000 |
commit | a7e78402b8b3d3583e7b63fcca99a4034a2f4db4 (patch) | |
tree | 8ecd3ec316861d81c9a1c552883a49b385d72567 /test/CodeGen | |
parent | 34f9d88221319054085934018a711fac5a65a6b1 (diff) | |
download | external_llvm-a7e78402b8b3d3583e7b63fcca99a4034a2f4db4.zip external_llvm-a7e78402b8b3d3583e7b63fcca99a4034a2f4db4.tar.gz external_llvm-a7e78402b8b3d3583e7b63fcca99a4034a2f4db4.tar.bz2 |
Custom lower (S|U)MUL_LOHI -> MACC(S|U)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/XCore/mul64.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/mul64.ll b/test/CodeGen/XCore/mul64.ll new file mode 100644 index 0000000..c42c2f5 --- /dev/null +++ b/test/CodeGen/XCore/mul64.ll @@ -0,0 +1,30 @@ +; RUN: llc < %s -march=xcore | FileCheck %s +define i64 @umul_lohi(i32 %a, i32 %b) { +entry: + %0 = zext i32 %a to i64 + %1 = zext i32 %b to i64 + %2 = mul i64 %1, %0 + ret i64 %2 +} +; CHECK: umul_lohi: +; CHECK: ldc r2, 0 +; CHECK-NEXT: mov r3, r2 +; CHECK-NEXT: maccu r2, r3, r1, r0 +; CHECK-NEXT: mov r0, r3 +; CHECK-NEXT: mov r1, r2 +; CHECK-NEXT: retsp 0 + +define i64 @smul_lohi(i32 %a, i32 %b) { +entry: + %0 = sext i32 %a to i64 + %1 = sext i32 %b to i64 + %2 = mul i64 %1, %0 + ret i64 %2 +} +; CHECK: smul_lohi: +; CHECK: ldc r2, 0 +; CHECK-NEXT: mov r3, r2 +; CHECK-NEXT: maccs r2, r3, r1, r0 +; CHECK-NEXT: mov r0, r3 +; CHECK-NEXT: mov r1, r2 +; CHECK-NEXT: retsp 0 |