From 54e1c0f1305665318b82e41baceeea137c3e61e9 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Thu, 9 Mar 2000 14:28:02 +0000 Subject: [PATCH] - src/base/digitseq/cl_asm_mips_.cc: Starting at argument 5 the parameter passing was changed for the MIPS n32 ABI. --- ChangeLog | 5 +++++ src/base/digitseq/cl_asm_mips_.cc | 25 ++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 997e797..fcd2578 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-02-22 Bruno Haible + + * src/base/digitseq/cl_asm_mips_.cc: Starting at argument 5 the + parameter passing was changed for the MIPS n32 ABI. + 2000-01-24 Richard Kreckel * gmp/*: Replaced the complete mpn sources with the ones from diff --git a/src/base/digitseq/cl_asm_mips_.cc b/src/base/digitseq/cl_asm_mips_.cc index a057c22..0f23dab 100644 --- a/src/base/digitseq/cl_asm_mips_.cc +++ b/src/base/digitseq/cl_asm_mips_.cc @@ -2,12 +2,23 @@ // Prozessor: MIPS // Endianness: irrelevant // Compiler: GNU-C oder ... -// Parameter-Übergabe: in Registern $4,$5,$6,$7, und auf dem Stack 16($sp),... +// Parameter-Übergabe: +// o32: in Registern $4,$5,$6,$7, und auf dem Stack 16($sp),... +// n32: in Registern $4,$5,$6,$7,$8,$9,$10,$11, und auf dem Stack 4($sp),... // Rückgabewert: in Register $2 // Einstellungen: intCsize=32, intDsize=32. // Besonderheiten: Nach jedem Ladebefehl ein Wartetakt nötig, bevor der // geholte Wert benutzt werden darf. +// Strictly speaking, the MIPS ABI (-32 or -n32) is independent from the CPU +// identification (-mips[12] or -mips[34]). But -n32 is commonly used together +// with -mips3, and it's easier to test the CPU identification. +#if __mips >= 3 + #define ABI_N32 1 +#else + #define ABI_O32 1 +#endif + // When this file is compiled into a shared library, ELF linkers need to // know which symbols are functions. #if defined(__GNU__) || defined(__NetBSD__) @@ -531,9 +542,13 @@ sld4: subu $12,$13 // dest = source1 - source2 // extern uintD subx_loop_down (uintD* sourceptr1, uintD* sourceptr2, uintD* destptr, uintC count, uintD carry); .align 2 DECLARE_FUNCTION(subx_loop_down) - .ent subx_loop_down // Input in $4,$5,$6,$7, Output in $2 + .ent subx_loop_down // Input in $4,$5,$6,$7,$8 Output in $2 subx_loop_down: +#if ABI_N32 + move $12,$8 // carry +#else lw $12,16($sp) // carry +#endif bnez $12,sxld5 // !(carry==0) ? b sxld2 sxld1: // kein Carry @@ -995,9 +1010,13 @@ slu4: subu $12,$13 // dest = source1 - source2 // extern uintD subx_loop_up (uintD* sourceptr1, uintD* sourceptr2, uintD* destptr, uintC count, uintD carry); .align 2 DECLARE_FUNCTION(subx_loop_up) - .ent subx_loop_up // Input in $4,$5,$6,$7, Output in $2 + .ent subx_loop_up // Input in $4,$5,$6,$7,$8, Output in $2 subx_loop_up: +#if ABI_N32 + move $12,$8 // carry +#else lw $12,16($sp) // carry +#endif bnez $12,sxlu5 // !(carry==0) ? b sxlu2 sxlu1: // kein Carry