1995-11-26 06:38:29 -08:00
|
|
|
;*********************************************************************
|
|
|
|
;* *
|
1996-04-30 07:53:58 -07:00
|
|
|
;* Objective Caml *
|
1995-11-26 06:38:29 -08: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-11-26 06:38:29 -08:00
|
|
|
;* Automatique. Distributed only by permission. *
|
|
|
|
;* *
|
|
|
|
;*********************************************************************
|
|
|
|
|
|
|
|
; $Id$
|
1996-06-22 04:35:42 -07:00
|
|
|
; Must be preprocessed by cpp
|
1995-11-26 06:38:29 -08:00
|
|
|
|
1996-06-22 04:35:42 -07:00
|
|
|
#ifdef SYS_hpux
|
|
|
|
#define G(x) x
|
1996-06-23 09:23:18 -07:00
|
|
|
#define CODESPACE .code
|
1996-06-22 04:35:42 -07:00
|
|
|
#define CODE_ALIGN 4
|
|
|
|
#define EXPORT_CODE(x) .export x, entry, priv_lev=3
|
|
|
|
#define STARTPROC .proc ! .callinfo frame=0, no_calls ! .entry
|
|
|
|
#define ENDPROC .exit ! .procend
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SYS_nextstep
|
|
|
|
#define G(x) _##x
|
1996-06-23 09:23:18 -07:00
|
|
|
#define CODESPACE .text
|
1996-06-22 04:35:42 -07:00
|
|
|
#define CODE_ALIGN 2
|
|
|
|
#define EXPORT_CODE(x) .globl x
|
|
|
|
#define STARTPROC
|
|
|
|
#define ENDPROC
|
|
|
|
#endif
|
|
|
|
|
1996-06-23 02:27:14 -07:00
|
|
|
#ifdef SYS_hpux
|
|
|
|
.space $PRIVATE$
|
|
|
|
.subspa $DATA$,quad=1,align=8,access=31
|
|
|
|
.subspa $BSS$,quad=1,align=8,access=31,zero,sort=82
|
|
|
|
.space $TEXT$
|
|
|
|
.subspa $LIT$,quad=0,align=8,access=44
|
|
|
|
.subspa $CODE$,quad=0,align=8,access=44,code_only
|
|
|
|
.import $global$, data
|
|
|
|
.import $$dyncall, millicode
|
|
|
|
#endif
|
|
|
|
|
1996-06-23 09:23:18 -07:00
|
|
|
CODESPACE
|
1996-06-22 04:35:42 -07:00
|
|
|
.align CODE_ALIGN
|
|
|
|
EXPORT_CODE(G(call_gen_code))
|
1996-06-23 02:27:14 -07:00
|
|
|
G(call_gen_code):
|
1996-06-22 04:35:42 -07:00
|
|
|
STARTPROC
|
1995-11-26 06:38:29 -08:00
|
|
|
stw %r2,-20(%r30)
|
|
|
|
ldo 256(%r30), %r30
|
|
|
|
; Save the callee-save registers
|
|
|
|
ldo -32(%r30), %r1
|
|
|
|
stws,ma %r3, -4(%r1)
|
|
|
|
stws,ma %r4, -4(%r1)
|
|
|
|
stws,ma %r5, -4(%r1)
|
|
|
|
stws,ma %r6, -4(%r1)
|
|
|
|
stws,ma %r7, -4(%r1)
|
|
|
|
stws,ma %r8, -4(%r1)
|
|
|
|
stws,ma %r9, -4(%r1)
|
|
|
|
stws,ma %r10, -4(%r1)
|
|
|
|
stws,ma %r11, -4(%r1)
|
|
|
|
stws,ma %r12, -4(%r1)
|
|
|
|
stws,ma %r13, -4(%r1)
|
|
|
|
stws,ma %r14, -4(%r1)
|
|
|
|
stws,ma %r15, -4(%r1)
|
|
|
|
stws,ma %r16, -4(%r1)
|
|
|
|
stws,ma %r17, -4(%r1)
|
|
|
|
stws,ma %r18, -4(%r1)
|
|
|
|
fstds,ma %fr12, -8(%r1)
|
|
|
|
fstds,ma %fr13, -8(%r1)
|
|
|
|
fstds,ma %fr14, -8(%r1)
|
|
|
|
fstds,ma %fr15, -8(%r1)
|
|
|
|
fstds,ma %fr16, -8(%r1)
|
|
|
|
fstds,ma %fr17, -8(%r1)
|
|
|
|
fstds,ma %fr18, -8(%r1)
|
|
|
|
fstds,ma %fr19, -8(%r1)
|
|
|
|
fstds,ma %fr20, -8(%r1)
|
|
|
|
fstds,ma %fr21, -8(%r1)
|
|
|
|
fstds,ma %fr22, -8(%r1)
|
|
|
|
fstds,ma %fr23, -8(%r1)
|
|
|
|
fstds,ma %fr24, -8(%r1)
|
|
|
|
fstds,ma %fr25, -8(%r1)
|
|
|
|
fstds,ma %fr26, -8(%r1)
|
|
|
|
fstds,ma %fr27, -8(%r1)
|
|
|
|
fstds,ma %fr28, -8(%r1)
|
|
|
|
fstds,ma %fr29, -8(%r1)
|
|
|
|
fstds,ma %fr30, -8(%r1)
|
|
|
|
fstds,ma %fr31, -8(%r1)
|
|
|
|
|
|
|
|
; Shuffle the arguments and call
|
|
|
|
copy %r26, %r22
|
|
|
|
copy %r25, %r26
|
|
|
|
copy %r24, %r25
|
|
|
|
copy %r23, %r24
|
|
|
|
fcpy,dbl %fr5, %fr4
|
1996-06-23 09:23:18 -07:00
|
|
|
#ifdef SYS_hpux
|
1996-06-22 04:35:42 -07:00
|
|
|
bl $$dyncall, %r2
|
|
|
|
nop
|
|
|
|
#else
|
1995-11-26 06:38:29 -08:00
|
|
|
ble 0(4, %r22)
|
|
|
|
copy %r31, %r2
|
1996-06-22 04:35:42 -07:00
|
|
|
#endif
|
1995-11-26 06:38:29 -08:00
|
|
|
; Shuffle the results
|
|
|
|
copy %r26, %r28
|
|
|
|
; Restore the callee-save registers
|
|
|
|
ldo -32(%r30), %r1
|
|
|
|
ldws,ma -4(%r1), %r3
|
|
|
|
ldws,ma -4(%r1), %r4
|
|
|
|
ldws,ma -4(%r1), %r5
|
|
|
|
ldws,ma -4(%r1), %r6
|
|
|
|
ldws,ma -4(%r1), %r7
|
|
|
|
ldws,ma -4(%r1), %r8
|
|
|
|
ldws,ma -4(%r1), %r9
|
|
|
|
ldws,ma -4(%r1), %r10
|
|
|
|
ldws,ma -4(%r1), %r11
|
|
|
|
ldws,ma -4(%r1), %r12
|
|
|
|
ldws,ma -4(%r1), %r13
|
|
|
|
ldws,ma -4(%r1), %r14
|
|
|
|
ldws,ma -4(%r1), %r15
|
|
|
|
ldws,ma -4(%r1), %r16
|
|
|
|
ldws,ma -4(%r1), %r17
|
|
|
|
ldws,ma -4(%r1), %r18
|
|
|
|
fldds,ma -8(%r1), %fr12
|
|
|
|
fldds,ma -8(%r1), %fr13
|
|
|
|
fldds,ma -8(%r1), %fr14
|
|
|
|
fldds,ma -8(%r1), %fr15
|
|
|
|
fldds,ma -8(%r1), %fr16
|
|
|
|
fldds,ma -8(%r1), %fr17
|
|
|
|
fldds,ma -8(%r1), %fr18
|
|
|
|
fldds,ma -8(%r1), %fr19
|
|
|
|
fldds,ma -8(%r1), %fr20
|
|
|
|
fldds,ma -8(%r1), %fr21
|
|
|
|
fldds,ma -8(%r1), %fr22
|
|
|
|
fldds,ma -8(%r1), %fr23
|
|
|
|
fldds,ma -8(%r1), %fr24
|
|
|
|
fldds,ma -8(%r1), %fr25
|
|
|
|
fldds,ma -8(%r1), %fr26
|
|
|
|
fldds,ma -8(%r1), %fr27
|
|
|
|
fldds,ma -8(%r1), %fr28
|
|
|
|
fldds,ma -8(%r1), %fr29
|
|
|
|
fldds,ma -8(%r1), %fr30
|
|
|
|
fldds,ma -8(%r1), %fr31
|
|
|
|
|
|
|
|
ldo -256(%r30), %r30
|
|
|
|
ldw -20(%r30), %r2
|
|
|
|
bv 0(%r2)
|
|
|
|
nop
|
1996-06-22 04:35:42 -07:00
|
|
|
ENDPROC
|
1995-11-26 06:38:29 -08:00
|
|
|
|
1996-06-23 02:27:14 -07:00
|
|
|
.align CODE_ALIGN
|
1996-06-22 04:35:42 -07:00
|
|
|
EXPORT_CODE(caml_c_call)
|
1996-06-23 02:27:14 -07:00
|
|
|
G(caml_c_call):
|
1996-06-22 04:35:42 -07:00
|
|
|
STARTPROC
|
|
|
|
#ifdef SYS_hpux
|
|
|
|
bl $$dyncall, %r0
|
|
|
|
nop
|
|
|
|
#else
|
1995-11-26 06:38:29 -08:00
|
|
|
bv 0(%r22)
|
|
|
|
nop
|
1996-06-22 04:35:42 -07:00
|
|
|
#endif
|
1996-06-23 02:27:14 -07:00
|
|
|
ENDPROC
|