aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/alpha_mach_dep.S
blob: 53547307a5d1d9aee0c6513a2dd9ada02ccc45ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
 # $Id: alpha_mach_dep.s,v 1.2 1993/01/18 22:54:51 dosser Exp $
	.arch ev6

        .text
        .align  4
        .globl  GC_push_regs
        .ent    GC_push_regs 2
GC_push_regs:
	ldgp    $gp, 0($27)
	lda     $sp, -16($sp)
	stq     $26, 0($sp)
        .mask   0x04000000, 0
        .frame  $sp, 16, $26, 0

 # $0		integer result
 # $1-$8	temp regs - not preserved cross calls
 # $9-$15	call saved regs
 # $16-$21	argument regs - not preserved cross calls
 # $22-$28	temp regs - not preserved cross calls
 # $29		global pointer - not preserved cross calls
 # $30		stack pointer

# define call_push(x)			\
	mov   x, $16;			\
	jsr   $26, GC_push_one;		\
	ldgp  $gp, 0($26)
	
        call_push($9)
        call_push($10)
        call_push($11)
        call_push($12)
        call_push($13)
        call_push($14)
        call_push($15)

 # $f0-$f1	floating point results
 # $f2-$f9	call saved regs
 # $f10-$f30	temp regs - not preserved cross calls

	# Use the most efficient transfer method for this hardware.
	# Bit 1 detects the FIX extension, which includes ftoit.
	amask	2, $0
	bne	$0, $use_stack

#undef call_push
#define call_push(x)			\
	ftoit	x, $16;			\
	jsr	$26, GC_push_one;	\
	ldgp	$gp, 0($26)

	call_push($f2)
	call_push($f3)
	call_push($f4)
	call_push($f5)
	call_push($f6)
	call_push($f7)
	call_push($f8)
	call_push($f9)

	ldq     $26, 0($sp)
	lda     $sp, 16($sp)
	ret     $31, ($26), 1

	.align	4
$use_stack:

#undef call_push
#define call_push(x)			\
	stt	x, 8($sp);		\
	ldq	$16, 8($sp);		\
	jsr	$26, GC_push_one;	\
	ldgp	$gp, 0($26)

	call_push($f2)
	call_push($f3)
	call_push($f4)
	call_push($f5)
	call_push($f6)
	call_push($f7)
	call_push($f8)
	call_push($f9)

	ldq     $26, 0($sp)
	lda     $sp, 16($sp)
	ret     $31, ($26), 1

	.end    GC_push_regs