1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/Mips/cconv/arguments-fp128.ll
Simon Dardis 224192bde8 [mips] Recommit: "N64 static relocation model support"
This patch makes one change to GOT handling and two changes to N64's
relocation model handling. Furthermore, the jumptable encodings have
been corrected for static N64.

Big GOT handling is now done via a new SDNode MipsGotHi - this node is
unconditionally lowered to an lui instruction.

The first change to N64's relocation handling is the lifting of the
restriction that N64 always uses PIC. Now it is possible to target static
environments.

The second change adds support for 64 bit symbols and enables them by
default. Previously N64 had patterns for sym32 mode only. In this mode all
symbols are assumed to have 32 bit addresses. sym32 mode support
is selectable with attribute 'sym32'. A follow on patch for clang will
add the necessary frontend parameter.

This partially resolves PR/23485.

Thanks to Brooks Davis for reporting the issue!

This version corrects a "Conditional jump or move depends on uninitialised
value(s)" error detected by valgrind present in the original commit.

Reviewers: dsanders, seanbruno, zoran.jovanovic, vkalintiris

Differential Revision: https://reviews.llvm.org/D23652

llvm-svn: 293279
2017-01-27 11:36:52 +00:00

52 lines
2.5 KiB
LLVM

; RUN: llc -march=mips64 -relocation-model=static -mattr=+soft-float -target-abi n32 < %s | FileCheck --check-prefixes=ALL,SYM32 %s
; RUN: llc -march=mips64el -relocation-model=static -mattr=+soft-float -target-abi n32 < %s | FileCheck --check-prefixes=ALL,SYM32 %s
; RUN: llc -march=mips64 -relocation-model=static -mattr=+soft-float -target-abi n64 < %s | FileCheck --check-prefixes=ALL,SYM64 %s
; RUN: llc -march=mips64el -relocation-model=static -mattr=+soft-float -target-abi n64 < %s | FileCheck --check-prefixes=ALL,SYM64 %s
; Test the fp128 arguments for all ABI's and byte orders as specified
; by section 2 of the MIPSpro N32 Handbook.
;
; O32 is not tested because long double is the same as double on O32.
@ldoubles = global [11 x fp128] zeroinitializer
define void @ldouble_args(fp128 %a, fp128 %b, fp128 %c, fp128 %d, fp128 %e) nounwind {
entry:
%0 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 1
store volatile fp128 %a, fp128* %0
%1 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 2
store volatile fp128 %b, fp128* %1
%2 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 3
store volatile fp128 %c, fp128* %2
%3 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 4
store volatile fp128 %d, fp128* %3
%4 = getelementptr [11 x fp128], [11 x fp128]* @ldoubles, i32 0, i32 5
store volatile fp128 %e, fp128* %4
ret void
}
; ALL-LABEL: ldouble_args:
; We won't test the way the global address is calculated in this test. This is
; just to get the register number for the other checks.
; SYM32-DAG: addiu [[R2:\$[0-9]+]], ${{[0-9]+}}, %lo(ldoubles)
; SYM64-DAG: daddiu [[R2:\$[0-9]]], ${{[0-9]+}}, %lo(ldoubles)
; The first four arguments are the same in N32/N64.
; The first argument is floating point but soft-float is enabled so floating
; point registers are not used.
; ALL-DAG: sd $4, 16([[R2]])
; ALL-DAG: sd $5, 24([[R2]])
; ALL-DAG: sd $6, 32([[R2]])
; ALL-DAG: sd $7, 40([[R2]])
; ALL-DAG: sd $8, 48([[R2]])
; ALL-DAG: sd $9, 56([[R2]])
; ALL-DAG: sd $10, 64([[R2]])
; ALL-DAG: sd $11, 72([[R2]])
; N32/N64 have run out of registers and starts using the stack too
; ALL-DAG: ld [[R3:\$[0-9]+]], 0($sp)
; ALL-DAG: ld [[R4:\$[0-9]+]], 8($sp)
; ALL-DAG: sd [[R3]], 80([[R2]])
; ALL-DAG: sd [[R4]], 88([[R2]])