	.TITLE	GCCLIB GNU CC compiler runtime support routines
	.IDENT	/1.00/

;
;	The following routines implement runtime functions for code
;	generated by GNU CC.
;
	.PSECT	$CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
	.ENTRY	UDIV,^M<R2>
	MOVL	4(AP),R0
	MOVL	8(AP),R2
	BEQL	1$
	CMPL	R2,#1
	BLEQ	2$
1$:	CLRL	R1
	EDIV	R2,R0,R0,R2
	RET
2$:	BEQL	10$
	CMPL	R0,R2
	BGEQU	20$
	CLRL	R0
	RET
20$:	MOVL	#1,R0
10$:	RET

	.ALIGN	LONG
	.ENTRY	UREM,^M<R2>
	MOVL	4(AP),R0
	MOVL	8(AP),R2
	BEQL	1$
	CMPL	R2,#1
	BLEQ	2$
1$:	CLRL	R1
	EDIV	R2,R0,R2,R0
	RET
2$:	BNEQ	10$
	CLRL	R0
	RET
10$:	CMPL	R0,R2
	BLSSU	100$
	SUBL2	R2,R0
100$:	RET

	.ALIGN	LONG
	.ENTRY	_LSHRSI3,^M<>
	MOVL	4(AP),R0
	SUBL3	8(AP),#32,R1
	EXTZV	8(AP),R1,R0,R0
	RET

	.ALIGN	LONG
	.ENTRY	_FIXUNS_TRUNCDFSI,^M<>
	CVTDL	4(AP),R0
	RET

	.END
