|
| 1 | +; Test the MSA intrinsics that are encoded with the SPECIAL instruction format. |
| 2 | + |
| 3 | +; RUN: llc -mtriple=mips-elf -mcpu=i6500 < %s | \ |
| 4 | +; RUN: FileCheck %s --check-prefix=MIPS32 |
| 5 | +; RUN: llc -mtriple=mips64-elf -mcpu=i6500 < %s | \ |
| 6 | +; RUN: FileCheck %s --check-prefix=MIPS64 |
| 7 | +; RUN: llc -mtriple=mips-elf -mcpu=i6500 < %s | \ |
| 8 | +; RUN: FileCheck %s --check-prefix=MIPS32 |
| 9 | +; RUN: llc -mtriple=mips64-elf -mcpu=i6500 < %s | \ |
| 10 | +; RUN: FileCheck %s --check-prefix=MIPS64 |
| 11 | +; RUN: llc -mtriple=mips-elf -mcpu=i6400 < %s | \ |
| 12 | +; RUN: FileCheck %s --check-prefix=MIPS32 |
| 13 | +; RUN: llc -mtriple=mips64-elf -mcpu=i6400 < %s | \ |
| 14 | +; RUN: FileCheck %s --check-prefix=MIPS64 |
| 15 | +; RUN: llc -mtriple=mips-elf -mcpu=i6400 < %s | \ |
| 16 | +; RUN: FileCheck %s --check-prefix=MIPS32 |
| 17 | +; RUN: llc -mtriple=mips64-elf -mcpu=i6400 < %s | \ |
| 18 | +; RUN: FileCheck %s --check-prefix=MIPS64 |
| 19 | + |
| 20 | +define i32 @llvm_mips_lsa_test(i32 %a, i32 %b) nounwind { |
| 21 | +entry: |
| 22 | + %0 = tail call i32 @llvm.mips.lsa(i32 %a, i32 %b, i32 2) |
| 23 | + ret i32 %0 |
| 24 | +} |
| 25 | + |
| 26 | +declare i32 @llvm.mips.lsa(i32, i32, i32) nounwind |
| 27 | + |
| 28 | +; MIPS32: llvm_mips_lsa_test: |
| 29 | +; MIPS32: lsa {{\$[0-9]+}}, $5, $4, 2 |
| 30 | +; MIPS32: .size llvm_mips_lsa_test |
| 31 | + |
| 32 | +define i32 @lsa_test(i32 %a, i32 %b) nounwind { |
| 33 | +entry: |
| 34 | + %0 = shl i32 %b, 2 |
| 35 | + %1 = add i32 %a, %0 |
| 36 | + ret i32 %1 |
| 37 | +} |
| 38 | + |
| 39 | +; MIPS32: lsa_test: |
| 40 | +; MIPS32: lsa {{\$[0-9]+}}, $5, $4, 2 |
| 41 | +; MIPS32: .size lsa_test |
| 42 | + |
| 43 | +define i64 @llvm_mips_dlsa_test(i64 %a, i64 %b) nounwind { |
| 44 | +entry: |
| 45 | + %0 = tail call i64 @llvm.mips.dlsa(i64 %a, i64 %b, i32 2) |
| 46 | + ret i64 %0 |
| 47 | +} |
| 48 | + |
| 49 | +declare i64 @llvm.mips.dlsa(i64, i64, i32) nounwind |
| 50 | + |
| 51 | +; MIPS64: llvm_mips_dlsa_test: |
| 52 | +; MIPS64: dlsa {{\$[0-9]+}}, $5, $4, 2 |
| 53 | +; MIPS64: .size llvm_mips_dlsa_test |
| 54 | + |
| 55 | +define i64 @dlsa_test(i64 %a, i64 %b) nounwind { |
| 56 | +entry: |
| 57 | + %0 = shl i64 %b, 2 |
| 58 | + %1 = add i64 %a, %0 |
| 59 | + ret i64 %1 |
| 60 | +} |
| 61 | + |
| 62 | +; MIPS64: dlsa_test: |
| 63 | +; MIPS64: dlsa {{\$[0-9]+}}, $5, $4, 2 |
| 64 | +; MIPS64: .size dlsa_test |
0 commit comments