mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-02 11:30:10 +00:00
Summary: I had difficulty finding tests for the N32 and N64 ABI so I've added a collection of calling convention tests based on the document MIPS ABIs Described (MD00305), the MIPSpro N32 Handbook, and the SYSV ABI. Where the documents/implementations disagree, I've used GCC to resolve the conflict. A few interesting details: * For N32, LLVM uses 64-bit pointers when saving $ra despite pointers being 32-bit. I've yet to find a supporting statement in the ABI documentation but the current behaviour matches GCC. * For O32, the non-variable portion of a varargs argument list is also subject to the rule that floating-point is passed via GPR's (on N32/N64 only the variable portion is subject to this rule). This agrees with GCC's behaviour and the SYSV ABI but contradicts part of the MIPSpro N32 Handbook which talks about O32's behaviour. * The N32 implementation has the wrong callee-saved register list. (I already have a fix for this but will commit it as a follow-up). I've left RUN-TODO lines in for O32 on MIPS64. I don't plan to support this case for now but we should revisit it. Reviewers: matheusalmeida, vmedic Reviewed By: matheusalmeida Differential Revision: http://reviews.llvm.org/D3339 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206370 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
1.4 KiB
LLVM
32 lines
1.4 KiB
LLVM
; RUN: llc -march=mips64 -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
|
|
; RUN: llc -march=mips64el -relocation-model=static -mattr=-n64,+n32 < %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
|
|
|
|
; RUN: llc -march=mips64 -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=N64 %s
|
|
; RUN: llc -march=mips64el -relocation-model=static -mattr=-n64,+n64 < %s | FileCheck --check-prefix=ALL --check-prefix=N64 %s
|
|
|
|
; Test the fp128 returns for N32/N64 and all byte orders as specified by
|
|
; section 5 of MD00305 (MIPS ABIs Described).
|
|
;
|
|
; O32 is not tested because long double is the same as double on O32.
|
|
;
|
|
@fp128 = global fp128 zeroinitializer
|
|
|
|
define fp128 @retldouble() nounwind {
|
|
entry:
|
|
%0 = load volatile fp128* @fp128
|
|
ret fp128 %0
|
|
}
|
|
|
|
; ALL-LABEL: retldouble:
|
|
; N32-DAG: ld [[R2:\$[0-9]+]], %lo(fp128)([[R1:\$[0-9]+]])
|
|
; N32-DAG: addiu [[R3:\$[0-9]+]], [[R1]], %lo(fp128)
|
|
; N32-DAG: ld [[R4:\$[0-9]+]], 8([[R3]])
|
|
; N32-DAG: dmtc1 [[R2]], $f0
|
|
; N32-DAG: dmtc1 [[R4]], $f2
|
|
|
|
; N64-DAG: ld [[R2:\$[0-9]+]], %got_disp(fp128)([[R1:\$[0-9]+]])
|
|
; N64-DAG: ld [[R3:\$[0-9]+]], 0([[R2]])
|
|
; N64-DAG: ld [[R4:\$[0-9]+]], 8([[R2]])
|
|
; N64-DAG: dmtc1 [[R3]], $f0
|
|
; N64-DAG: dmtc1 [[R4]], $f2
|