|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
1 | 2 | ; Test the MSA intrinsics that are encoded with the SPECIAL instruction format. |
2 | 3 |
|
3 | 4 | ; RUN: llc -mtriple=mips-elf -mcpu=i6500 < %s | \ |
4 | 5 | ; 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 |
| 6 | +; RUN: llc -mtriple=mips-elf -mcpu=i6500 -mattr=-msa < %s | \ |
| 7 | +; RUN: FileCheck %s --check-prefix=MIPS32-NO-LSA |
| 8 | + |
9 | 9 | ; RUN: llc -mtriple=mips64-elf -mcpu=i6500 < %s | \ |
10 | 10 | ; RUN: FileCheck %s --check-prefix=MIPS64 |
11 | 11 | ; RUN: llc -mtriple=mips64-elf -mcpu=i6500 -mattr=-msa < %s | \ |
12 | | -; RUN: FileCheck %s --check-prefix=NO-DSLA |
13 | | -; RUN: llc -mtriple=mips-elf -mcpu=i6400 < %s | \ |
14 | | -; RUN: FileCheck %s --check-prefix=MIPS32 |
15 | | -; RUN: llc -mtriple=mips64-elf -mcpu=i6400 < %s | \ |
16 | | -; RUN: FileCheck %s --check-prefix=MIPS64 |
| 12 | +; RUN: FileCheck %s --check-prefix=MIPS64-NO-DLSA |
| 13 | + |
17 | 14 | ; RUN: llc -mtriple=mips-elf -mcpu=i6400 < %s | \ |
18 | 15 | ; RUN: FileCheck %s --check-prefix=MIPS32 |
| 16 | +; RUN: llc -mtriple=mips-elf -mcpu=i6400 -mattr=-msa < %s | \ |
| 17 | +; RUN: FileCheck %s --check-prefix=MIPS32-NO-LSA |
| 18 | + |
19 | 19 | ; RUN: llc -mtriple=mips64-elf -mcpu=i6400 < %s | \ |
20 | 20 | ; RUN: FileCheck %s --check-prefix=MIPS64 |
21 | 21 | ; RUN: llc -mtriple=mips64-elf -mcpu=i6400 -mattr=-msa < %s | \ |
22 | | -; RUN: FileCheck %s --check-prefix=NO-DSLA |
| 22 | +; RUN: FileCheck %s --check-prefix=MIPS64-NO-DLSA |
23 | 23 |
|
24 | 24 | define i32 @llvm_mips_lsa_test(i32 %a, i32 %b) nounwind { |
| 25 | +; MIPS32-LABEL: llvm_mips_lsa_test: |
| 26 | +; MIPS32: # %bb.0: # %entry |
| 27 | +; MIPS32-NEXT: jr $ra |
| 28 | +; MIPS32-NEXT: lsa $2, $5, $4, 2 |
| 29 | +; |
| 30 | +; MIPS32-NO-LSA-LABEL: llvm_mips_lsa_test: |
| 31 | +; MIPS32-NO-LSA: # %bb.0: # %entry |
| 32 | +; MIPS32-NO-LSA-NEXT: sll $1, $5, 2 |
| 33 | +; MIPS32-NO-LSA-NEXT: jr $ra |
| 34 | +; MIPS32-NO-LSA-NEXT: addu $2, $4, $1 |
| 35 | +; |
| 36 | +; MIPS64-LABEL: llvm_mips_lsa_test: |
| 37 | +; MIPS64: # %bb.0: # %entry |
| 38 | +; MIPS64-NEXT: sll $1, $4, 0 |
| 39 | +; MIPS64-NEXT: sll $2, $5, 0 |
| 40 | +; MIPS64-NEXT: jr $ra |
| 41 | +; MIPS64-NEXT: lsa $2, $2, $1, 2 |
| 42 | +; |
| 43 | +; MIPS64-NO-DLSA-LABEL: llvm_mips_lsa_test: |
| 44 | +; MIPS64-NO-DLSA: # %bb.0: # %entry |
| 45 | +; MIPS64-NO-DLSA-NEXT: sll $1, $4, 0 |
| 46 | +; MIPS64-NO-DLSA-NEXT: sll $2, $5, 0 |
| 47 | +; MIPS64-NO-DLSA-NEXT: sll $2, $2, 2 |
| 48 | +; MIPS64-NO-DLSA-NEXT: jr $ra |
| 49 | +; MIPS64-NO-DLSA-NEXT: addu $2, $1, $2 |
25 | 50 | entry: |
26 | 51 | %0 = tail call i32 @llvm.mips.lsa(i32 %a, i32 %b, i32 2) |
27 | 52 | ret i32 %0 |
28 | 53 | } |
29 | | - |
30 | 54 | declare i32 @llvm.mips.lsa(i32, i32, i32) nounwind |
31 | 55 |
|
32 | | -; MIPS32: llvm_mips_lsa_test: |
33 | | -; MIPS32: lsa {{\$[0-9]+}}, $5, $4, 2 |
34 | | -; MIPS32: .size llvm_mips_lsa_test |
35 | | - |
36 | | -define i32 @lsa_test(i32 %a, i32 %b) nounwind { |
37 | | -entry: |
38 | | - %0 = shl i32 %b, 2 |
39 | | - %1 = add i32 %a, %0 |
40 | | - ret i32 %1 |
41 | | -} |
42 | | - |
43 | | -; MIPS32: lsa_test: |
44 | | -; MIPS32: lsa {{\$[0-9]+}}, $5, $4, 2 |
45 | | -; MIPS32: .size lsa_test |
46 | | - |
47 | 56 | define i64 @llvm_mips_dlsa_test(i64 %a, i64 %b) nounwind { |
| 57 | +; MIPS32-LABEL: llvm_mips_dlsa_test: |
| 58 | +; MIPS32: # %bb.0: # %entry |
| 59 | +; MIPS32-NEXT: dmfc1 $1, $f14 |
| 60 | +; MIPS32-NEXT: dmfc1 $2, $f12 |
| 61 | +; MIPS32-NEXT: dlsa $1, $1, $2, 2 |
| 62 | +; MIPS32-NEXT: jr $ra |
| 63 | +; MIPS32-NEXT: sd $1, 0($4) |
| 64 | +; |
| 65 | +; MIPS32-NO-LSA-LABEL: llvm_mips_dlsa_test: |
| 66 | +; MIPS32-NO-LSA: # %bb.0: # %entry |
| 67 | +; MIPS32-NO-LSA-NEXT: dmfc1 $1, $f14 |
| 68 | +; MIPS32-NO-LSA-NEXT: dmfc1 $2, $f12 |
| 69 | +; MIPS32-NO-LSA-NEXT: dsll $1, $1, 2 |
| 70 | +; MIPS32-NO-LSA-NEXT: daddu $1, $2, $1 |
| 71 | +; MIPS32-NO-LSA-NEXT: jr $ra |
| 72 | +; MIPS32-NO-LSA-NEXT: sd $1, 0($4) |
| 73 | +; |
| 74 | +; MIPS64-LABEL: llvm_mips_dlsa_test: |
| 75 | +; MIPS64: # %bb.0: # %entry |
| 76 | +; MIPS64-NEXT: jr $ra |
| 77 | +; MIPS64-NEXT: dlsa $2, $5, $4, 2 |
| 78 | +; |
| 79 | +; MIPS64-NO-DLSA-LABEL: llvm_mips_dlsa_test: |
| 80 | +; MIPS64-NO-DLSA: # %bb.0: # %entry |
| 81 | +; MIPS64-NO-DLSA-NEXT: dsll $1, $5, 2 |
| 82 | +; MIPS64-NO-DLSA-NEXT: jr $ra |
| 83 | +; MIPS64-NO-DLSA-NEXT: daddu $2, $4, $1 |
48 | 84 | entry: |
49 | 85 | %0 = tail call i64 @llvm.mips.dlsa(i64 %a, i64 %b, i32 2) |
50 | 86 | ret i64 %0 |
51 | 87 | } |
52 | | - |
53 | 88 | declare i64 @llvm.mips.dlsa(i64, i64, i32) nounwind |
54 | | - |
55 | | -; MIPS64: llvm_mips_dlsa_test: |
56 | | -; MIPS64: dlsa {{\$[0-9]+}}, $5, $4, 2 |
57 | | -; MIPS64: .size llvm_mips_dlsa_test |
58 | | -; NO-DSLA-NOT: dlsa {{\$[0-9]+}}, $5, $4, 2 |
59 | | -define i64 @dlsa_test(i64 %a, i64 %b) nounwind { |
60 | | -entry: |
61 | | - %0 = shl i64 %b, 2 |
62 | | - %1 = add i64 %a, %0 |
63 | | - ret i64 %1 |
64 | | -} |
65 | | - |
66 | | -; MIPS64: dlsa_test: |
67 | | -; MIPS64: dlsa {{\$[0-9]+}}, $5, $4, 2 |
68 | | -; MIPS64: .size dlsa_test |
69 | | -; NO-DSLA-NOT: dlsa {{\$[0-9]+}}, $5, $4, 2 |
|
0 commit comments