#***************************************************************************/
#**                                                                        */
#**                                 Sources                                */
#**                                from  the                               */
#**                           XSC SOFTWARE PACKAGE                         */
#**                                                                        */
#**                Copyright (c) 1997 University of Karlsruhe              */
#**                     Institute for Appl. Mathematics                    */
#**                                                                        */
#** This program is free software for non-commercial use. For details, see */
#** the file LICENSE.XSC, distributed with this software package.          */
#**                                                                        */
#** This program is distributed WITHOUT ANY WARRANTY. For details, see the */
#** file LICENSE.XSC, distributed with this software package.              */
#**                                                                        */
#***************************************************************************/
#*
# RCS $Id: r_ari.s,v 1.3 1997/09/25 16:16:55 ae59 Exp $
	.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; 
	.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4

	.globl	.r_addn                 
	.globl	.r_addu                 
	.globl	.r_addd                 
	.globl	.r_subn                 
	.globl	.r_subu                 
	.globl	.r_subd                 
	.globl	.r_muln                 
	.globl	.r_mulu                 
	.globl	.r_muld                 
	.globl	.r_divn                 
	.globl	.r_divu                 
	.globl	.r_divd                 
	.globl	.r_lfsr
	.extern e_srdn{UA}
	.extern e_srdu{UA}
	.extern e_srdd{UA}


# .text section

	.csect	r_ari{PR}      

.r_addn:
	l	r3,T.e_srdn(RTOC)	# Adresse von e_srdn nach R3
	lfd	fp3,0(r3)		# Inhalt von e_srdn nach fp3
	mtfsf	0xff,fp3		# lade fp3 in das Statusregister fpscr
	fa	fp1,fp1,fp2		# Addition, Rueckgabe in fp1
	mffs	fp3			# speichere fpscr in fp3
	stfd	fp3,0(r3)		# speicher fp3 zurueck nach e_srdn
	br

.r_addu:
	l	r3,T.e_srdu(RTOC)
	lfd	fp3,0(r3)
	mtfsf	0xff,fp3
	fa	fp1,fp1,fp2
	mffs	fp3
	stfd	fp3,0(r3)
	br

.r_addd:
	l	r3,T.e_srdd(RTOC)
	lfd	fp3,0(r3)
	mtfsf	0xff,fp3
	fa	fp1,fp1,fp2
	mffs	fp3
	stfd	fp3,0(r3)
	br

.r_subn:
	l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