]> www.ginac.de Git - cln.git/commitdiff
- src/base/digitseq/cl_asm_mips_.cc: Starting at argument 5 the
authorRichard Kreckel <kreckel@ginac.de>
Thu, 9 Mar 2000 14:28:02 +0000 (14:28 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 9 Mar 2000 14:28:02 +0000 (14:28 +0000)
parameter passing was changed for the MIPS n32 ABI.

ChangeLog
src/base/digitseq/cl_asm_mips_.cc

index 997e7974cb060788f4b188dff2610990c5538dd1..fcd2578de8370f60f4b7bba1653430e70bda1686 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-02-22  Bruno Haible  <haible@clisp.cons.org>
+
+        * 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  <kreckel@ginac.de>
 
         * gmp/*: Replaced the complete mpn sources with the ones from
index a057c2277b94c730b7d285ebf76ccf17077dc4d9..0f23dab1e0eb3985b8fdf29253c6d8b3875ebecb 100644 (file)
@@ -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