xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/cconv/arguments-hard-fp128.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips64 -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,SYM32 %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips64el -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefixes=ALL,SYM32 %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips64 -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,SYM64 %s
5*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips64el -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefixes=ALL,SYM64 %s
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; Test the fp128 arguments for all ABI's and byte orders as specified
8*9880d681SAndroid Build Coastguard Worker; by section 2 of the MIPSpro N32 Handbook.
9*9880d681SAndroid Build Coastguard Worker;
10*9880d681SAndroid Build Coastguard Worker; O32 is not tested because long double is the same as double on O32.
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker@ldoubles = global [11 x fp128] zeroinitializer
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @ldouble_args(fp128 %a, fp128 %b, fp128 %c, fp128 %d, fp128 %e) nounwind {
15*9880d681SAndroid Build Coastguard Workerentry:
16*9880d681SAndroid Build Coastguard Worker        %0 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 1
17*9880d681SAndroid Build Coastguard Worker        store volatile fp128 %a, fp128* %0
18*9880d681SAndroid Build Coastguard Worker        %1 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 2
19*9880d681SAndroid Build Coastguard Worker        store volatile fp128 %b, fp128* %1
20*9880d681SAndroid Build Coastguard Worker        %2 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 3
21*9880d681SAndroid Build Coastguard Worker        store volatile fp128 %c, fp128* %2
22*9880d681SAndroid Build Coastguard Worker        %3 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 4
23*9880d681SAndroid Build Coastguard Worker        store volatile fp128 %d, fp128* %3
24*9880d681SAndroid Build Coastguard Worker        %4 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 5
25*9880d681SAndroid Build Coastguard Worker        store volatile fp128 %e, fp128* %4
26*9880d681SAndroid Build Coastguard Worker        ret void
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker; ALL-LABEL: ldouble_args:
30*9880d681SAndroid Build Coastguard Worker; We won't test the way the global address is calculated in this test. This is
31*9880d681SAndroid Build Coastguard Worker; just to get the register number for the other checks.
32*9880d681SAndroid Build Coastguard Worker; SYM32-DAG:           addiu [[R2:\$[0-9]+]], ${{[0-9]+}}, %lo(ldoubles)
33*9880d681SAndroid Build Coastguard Worker; SYM64-DAG:           ld [[R2:\$[0-9]]], %got_disp(ldoubles)(
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Worker; The first four arguments are the same in N32/N64.
36*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f12, 16([[R2]])
37*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f13, 24([[R2]])
38*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f14, 32([[R2]])
39*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f15, 40([[R2]])
40*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f16, 48([[R2]])
41*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f17, 56([[R2]])
42*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f18, 64([[R2]])
43*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sdc1 $f19, 72([[R2]])
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker; N32/N64 have run out of registers and starts using the stack too
46*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           ld [[R3:\$[0-9]+]], 0($sp)
47*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           ld [[R4:\$[0-9]+]], 8($sp)
48*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sd [[R3]], 80([[R2]])
49*9880d681SAndroid Build Coastguard Worker; ALL-DAG:           sd [[R4]], 88([[R2]])
50