diff options
| author | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-02-10 12:05:17 +0000 |
|---|---|---|
| committer | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-02-10 12:05:17 +0000 |
| commit | 4b27eb588cd95d953110e1eb009f5e5018a9955c (patch) | |
| tree | db4c8c0dd684bf696c8354c559691c13cbc28e50 /llvm/test/CodeGen/Mips/msa/special.ll | |
| parent | b4133b25e7641bd9d76bba8ee3b960e13d64ea66 (diff) | |
| download | bcm5719-llvm-4b27eb588cd95d953110e1eb009f5e5018a9955c.tar.gz bcm5719-llvm-4b27eb588cd95d953110e1eb009f5e5018a9955c.zip | |
[mips][msa] Add DLSA instruction.
llvm-svn: 201081
Diffstat (limited to 'llvm/test/CodeGen/Mips/msa/special.ll')
| -rw-r--r-- | llvm/test/CodeGen/Mips/msa/special.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/msa/special.ll b/llvm/test/CodeGen/Mips/msa/special.ll index b325c68b6a1..f65a14f7bb1 100644 --- a/llvm/test/CodeGen/Mips/msa/special.ll +++ b/llvm/test/CodeGen/Mips/msa/special.ll @@ -2,6 +2,8 @@ ; RUN: llc -march=mips -mattr=+msa,+fp64 < %s | \ ; RUN: FileCheck %s --check-prefix=MIPS32 +; RUN: llc -march=mips64 -mcpu=mips64r2 -mattr=+msa,+fp64 < %s | \ +; RUN: FileCheck %s --check-prefix=MIPS64 define i32 @llvm_mips_lsa_test(i32 %a, i32 %b) nounwind { entry: @@ -25,3 +27,26 @@ entry: ; MIPS32: lsa_test: ; MIPS32: lsa {{\$[0-9]+}}, $5, $4, 2 ; MIPS32: .size lsa_test + +define i64 @llvm_mips_dlsa_test(i64 %a, i64 %b) nounwind { +entry: + %0 = tail call i64 @llvm.mips.dlsa(i64 %a, i64 %b, i32 2) + ret i64 %0 +} + +declare i64 @llvm.mips.dlsa(i64, i64, i32) nounwind + +; MIPS64: llvm_mips_dlsa_test: +; MIPS64: dlsa {{\$[0-9]+}}, $5, $4, 2 +; MIPS64: .size llvm_mips_dlsa_test + +define i64 @dlsa_test(i64 %a, i64 %b) nounwind { +entry: + %0 = shl i64 %b, 2 + %1 = add i64 %a, %0 + ret i64 %1 +} + +; MIPS64: dlsa_test: +; MIPS64: dlsa {{\$[0-9]+}}, $5, $4, 2 +; MIPS64: .size dlsa_test |

