	TITLE libgcc1

#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
#define FUNC(x) CONCAT1 (UNDERSCORE, x)

/* The sequences for udivsi3 and umodsi3 were taken from KCC and are
   derived from one suggested by Peter Samson at Systems Concepts.  */
	
#ifdef L_udivsi3
	ENTRY FUNC(udivsi3)
FUNC(udivsi3):
	SKIPGE 3,2
	 JRST .+10
	JUMPGE 1,.+17
	CAIG 3,1
	 JRST .+14
	MOVE 2,1
	MOVEI 1,1
	DIV 1,3
	JRST .+12
%L1:	MOVE 2,1
	MOVEI 1,0
	JUMPGE 2,.+7
	CAMGE 2,3
	 JRST .+5
	SUB 2,3
	AOJA 1,.+3
%L2:	TDZA 2,2
%L3:	IDIV 1,3
%L4:	POPJ 17,
#endif

#ifdef L_umodsi3
	ENTRY FUNC(umodsi3)
FUNC(umodsi3):
	SKIPGE 3,2
	 JRST %L5
	JUMPGE 1,%L7
	CAIG 3,1
	 JRST %L6
	MOVE 2,1
	MOVEI 1,1
	DIV 1,3
	JRST %L8
%L5:	MOVE 2,1
	MOVEI 1,0
	JUMPGE 2,%L8
	CAMGE 2,3
	 JRST %L8
	SUB 2,3
	AOJA 1,%L8
%L6:	TDZA 2,2
%L7:	IDIV 1,3
%L8:	MOVE 1,2
	POPJ 17,
#endif

#ifdef L_adddf3
	ENTRY FUNC(adddf3)
FUNC(adddf3):
	SETZB 1,2
	POPJ 17,
#endif

#ifdef L_subdf3
	ENTRY FUNC(subdf3)
FUNC(subdf3):
	SETZB 1,2
	POPJ 17,
#endif

#ifdef L_negdf2
	ENTRY FUNC(negdf2)
FUNC(negdf2):
	SETZB 1,2
	POPJ 17,
#endif

#ifdef L_muldf3
	ENTRY FUNC(muldf3)
FUNC(muldf3):
	SETZB 1,2
	POPJ 17,
#endif

#ifdef L_divdf3
	ENTRY FUNC(divdf3)
FUNC(divdf3):
	SETZB 1,2
	POPJ 17,
#endif

#ifdef L_eqdf2
	ENTRY FUNC(eqdf2)
FUNC(eqdf2):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_nedf2
	ENTRY FUNC(nedf2)
FUNC(nedf2):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_gtdf2
	ENTRY FUNC(gtdf2)
FUNC(gtdf2):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_gedf2
	ENTRY FUNC(gedf2)
FUNC(gedf2):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_ltdf2
	ENTRY FUNC(ltdf2)
FUNC(ltdf2):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_ledf2
	ENTRY FUNC(ledf2)
FUNC(ledf2):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_fixsfsi
	ENTRY FUNC(fxsfsi)
FUNC(fxsfsi):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_fixdfsi
	ENTRY FUNC(fxdfsi)
FUNC(fxdfsi):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_floatsisf
	ENTRY FUNC(flsisf)
FUNC(flsisf):
	MOVEI 1,0
	POPJ 17,
#endif

#ifdef L_floatsidf
	ENTRY FUNC(flsidf)
FUNC(flsidf):
	SETZB 1,2
	POPJ 17,
#endif

#ifdef LBADL6
	ENTRY %BADL6
%BADL6:
#endif

#ifdef LBADL7
	ENTRY %BADL7
%BADL7:
#endif

#ifdef LBADL8
	ENTRY %BADL8
%BADL8:
#endif

#ifdef LBADL9
	ENTRY %BADL9
%BADL9:
#endif

#ifdef LBADLH
	ENTRY %BADLH
%BADLH:
#endif

#ifdef LBADX6
	ENTRY %BADX6
%BADX6:
#endif

#ifdef LBADX7
	ENTRY %BADX7
%BADX7:
#endif

#ifdef LBADX8
	ENTRY %BADX8
%BADX8:
#endif

#ifdef LBADX9
	ENTRY %BADX9
%BADX9:
#endif

#ifdef LBADXH
	ENTRY %BADXH
%BADXH:
#endif

	END
