1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1995-07-17 08:58:46 -07:00
|
|
|
.globl call_gen_code
|
|
|
|
.ent call_gen_code
|
|
|
|
call_gen_code:
|
1997-02-03 02:14:54 -08:00
|
|
|
subu $sp, $sp, 96
|
|
|
|
sw $31, 88($sp)
|
1995-07-17 08:58:46 -07:00
|
|
|
/* Save all callee-save registers */
|
|
|
|
sw $16, 0($sp)
|
|
|
|
sw $17, 4($sp)
|
|
|
|
sw $18, 8($sp)
|
|
|
|
sw $19, 12($sp)
|
|
|
|
sw $20, 16($sp)
|
|
|
|
sw $21, 20($sp)
|
|
|
|
sw $22, 24($sp)
|
|
|
|
sw $23, 28($sp)
|
|
|
|
sw $30, 32($sp)
|
1997-02-03 02:14:54 -08:00
|
|
|
s.d $f20, 40($sp)
|
|
|
|
s.d $f22, 48($sp)
|
|
|
|
s.d $f24, 56($sp)
|
|
|
|
s.d $f26, 64($sp)
|
|
|
|
s.d $f28, 72($sp)
|
|
|
|
s.d $f30, 80($sp)
|
1995-07-17 08:58:46 -07:00
|
|
|
/* Shuffle arguments */
|
|
|
|
move $8, $5
|
|
|
|
move $9, $6
|
|
|
|
move $10, $7
|
1997-02-02 06:54:46 -08:00
|
|
|
#ifdef _PIC
|
|
|
|
move $25, $4
|
|
|
|
#endif
|
1995-07-17 08:58:46 -07:00
|
|
|
jal $4
|
|
|
|
/* Restore registers */
|
1997-02-03 02:14:54 -08:00
|
|
|
lw $31, 88($sp)
|
1995-07-17 08:58:46 -07:00
|
|
|
lw $16, 0($sp)
|
|
|
|
lw $17, 4($sp)
|
|
|
|
lw $18, 8($sp)
|
|
|
|
lw $19, 12($sp)
|
|
|
|
lw $20, 16($sp)
|
|
|
|
lw $21, 20($sp)
|
|
|
|
lw $22, 24($sp)
|
|
|
|
lw $23, 28($sp)
|
|
|
|
lw $30, 32($sp)
|
1997-02-03 02:14:54 -08:00
|
|
|
l.d $f20, 40($sp)
|
|
|
|
l.d $f22, 48($sp)
|
|
|
|
l.d $f24, 56($sp)
|
|
|
|
l.d $f26, 64($sp)
|
|
|
|
l.d $f28, 72($sp)
|
|
|
|
l.d $f30, 80($sp)
|
|
|
|
addu $sp, $sp, 96
|
1995-07-17 08:58:46 -07:00
|
|
|
j $31
|
|
|
|
|
|
|
|
.end call_gen_code
|
|
|
|
|
|
|
|
/* Call a C function */
|
|
|
|
|
|
|
|
.globl caml_c_call
|
|
|
|
.ent caml_c_call
|
|
|
|
caml_c_call:
|
1997-02-02 06:54:46 -08:00
|
|
|
#ifdef _PIC
|
|
|
|
move $25, $24
|
|
|
|
#endif
|
1997-02-01 09:40:41 -08:00
|
|
|
j $24
|
1995-07-17 08:58:46 -07:00
|
|
|
.end caml_c_call
|