1	.arch ev6
2
3        .text
4        .align  4
5        .globl  GCROOTS_push_regs
6        .ent    GCROOTS_push_regs 2
7GCROOTS_push_regs:
8	ldgp    $gp, 0($27)
9	lda     $sp, -16($sp)
10	stq     $26, 0($sp)
11        .mask   0x04000000, 0
12        .frame  $sp, 16, $26, 0
13
14/* $0		integer result                                                */
15/* $1-$8	temp regs - not preserved cross calls                         */
16/* $9-$15	call saved regs                                               */
17/* $16-$21	argument regs - not preserved cross calls                     */
18/* $22-$28	temp regs - not preserved cross calls                         */
19/* $29		global pointer - not preserved cross calls                    */
20/* $30		stack pointer                                                 */
21
22# define call_push(x)			\
23	mov   x, $16;			\
24	jsr   $26, GCROOTS_push_one;		\
25	ldgp  $gp, 0($26)
26
27        call_push($9)
28        call_push($10)
29        call_push($11)
30        call_push($12)
31        call_push($13)
32        call_push($14)
33        call_push($15)
34
35/* $f0-$f1	floating point results                                        */
36/* $f2-$f9	call saved regs                                               */
37/* $f10-$f30	temp regs - not preserved cross calls                         */
38
39	/* Use the most efficient transfer method for this hardware. */
40	/* Bit 1 detects the FIX extension, which includes ftoit. */
41	amask	2, $0
42	bne	$0, $use_stack
43
44#undef call_push
45#define call_push(x)			\
46	ftoit	x, $16;			\
47	jsr	$26, GCROOTS_push_one;	\
48	ldgp	$gp, 0($26)
49
50	call_push($f2)
51	call_push($f3)
52	call_push($f4)
53	call_push($f5)
54	call_push($f6)
55	call_push($f7)
56	call_push($f8)
57	call_push($f9)
58
59	ldq     $26, 0($sp)
60	lda     $sp, 16($sp)
61	ret     $31, ($26), 1
62
63	.align	4
64$use_stack:
65
66#undef call_push
67#define call_push(x)			\
68	stt	x, 8($sp);		\
69	ldq	$16, 8($sp);		\
70	jsr	$26, GCROOTS_push_one;	\
71	ldgp	$gp, 0($26)
72
73	call_push($f2)
74	call_push($f3)
75	call_push($f4)
76	call_push($f5)
77	call_push($f6)
78	call_push($f7)
79	call_push($f8)
80	call_push($f9)
81
82	ldq     $26, 0($sp)
83	lda     $sp, 16($sp)
84	ret     $31, ($26), 1
85
86	.end    GCROOTS_push_regs
87