blob: 086ba9bce27a4d489e6781711fde822f4d3b1dd8 [file] [log] [blame]
Daniel Sanders0d972702016-06-24 12:23:17 +00001; RUN: llc -march=mips64 -relocation-model=static -mattr=+soft-float -target-abi n32 < %s | FileCheck --check-prefixes=ALL,SYM32 %s
2; RUN: llc -march=mips64el -relocation-model=static -mattr=+soft-float -target-abi n32 < %s | FileCheck --check-prefixes=ALL,SYM32 %s
Daniel Sanders9fe0ad02014-04-16 09:59:46 +00003
Daniel Sanders0d972702016-06-24 12:23:17 +00004; RUN: llc -march=mips64 -relocation-model=static -mattr=+soft-float -target-abi n64 < %s | FileCheck --check-prefixes=ALL,SYM64 %s
5; RUN: llc -march=mips64el -relocation-model=static -mattr=+soft-float -target-abi n64 < %s | FileCheck --check-prefixes=ALL,SYM64 %s
Daniel Sanders9fe0ad02014-04-16 09:59:46 +00006
7; Test the fp128 arguments for all ABI's and byte orders as specified
8; by section 2 of the MIPSpro N32 Handbook.
9;
10; O32 is not tested because long double is the same as double on O32.
11
12@ldoubles = global [11 x fp128] zeroinitializer
13
14define void @ldouble_args(fp128 %a, fp128 %b, fp128 %c, fp128 %d, fp128 %e) nounwind {
15entry:
David Blaikie79e6c742015-02-27 19:29:02 +000016 %0 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 1
Daniel Sanders9fe0ad02014-04-16 09:59:46 +000017 store volatile fp128 %a, fp128* %0
David Blaikie79e6c742015-02-27 19:29:02 +000018 %1 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 2
Daniel Sanders9fe0ad02014-04-16 09:59:46 +000019 store volatile fp128 %b, fp128* %1
David Blaikie79e6c742015-02-27 19:29:02 +000020 %2 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 3
Daniel Sanders9fe0ad02014-04-16 09:59:46 +000021 store volatile fp128 %c, fp128* %2
David Blaikie79e6c742015-02-27 19:29:02 +000022 %3 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 4
Daniel Sanders9fe0ad02014-04-16 09:59:46 +000023 store volatile fp128 %d, fp128* %3
David Blaikie79e6c742015-02-27 19:29:02 +000024 %4 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 5
Daniel Sanders9fe0ad02014-04-16 09:59:46 +000025 store volatile fp128 %e, fp128* %4
26 ret void
27}
28
29; ALL-LABEL: ldouble_args:
30; We won't test the way the global address is calculated in this test. This is
31; just to get the register number for the other checks.
32; SYM32-DAG: addiu [[R2:\$[0-9]+]], ${{[0-9]+}}, %lo(ldoubles)
Simon Dardisca74dd72017-01-27 11:36:52 +000033; SYM64-DAG: daddiu [[R2:\$[0-9]]], ${{[0-9]+}}, %lo(ldoubles)
Daniel Sanders9fe0ad02014-04-16 09:59:46 +000034
35; The first four arguments are the same in N32/N64.
36; The first argument is floating point but soft-float is enabled so floating
37; point registers are not used.
38; ALL-DAG: sd $4, 16([[R2]])
39; ALL-DAG: sd $5, 24([[R2]])
40; ALL-DAG: sd $6, 32([[R2]])
41; ALL-DAG: sd $7, 40([[R2]])
42; ALL-DAG: sd $8, 48([[R2]])
43; ALL-DAG: sd $9, 56([[R2]])
44; ALL-DAG: sd $10, 64([[R2]])
45; ALL-DAG: sd $11, 72([[R2]])
46
47; N32/N64 have run out of registers and starts using the stack too
48; ALL-DAG: ld [[R3:\$[0-9]+]], 0($sp)
49; ALL-DAG: ld [[R4:\$[0-9]+]], 8($sp)
50; ALL-DAG: sd [[R3]], 80([[R2]])
51; ALL-DAG: sd [[R4]], 88([[R2]])