xref: /csrg-svn/sys/tahoe/math/Kfrexpd.s (revision 45761)
1*45761Sbostic/*-
2*45761Sbostic * Copyright (c) 1985 The Regents of the University of California.
3*45761Sbostic * All rights reserved.
4*45761Sbostic *
5*45761Sbostic * This code is derived from software contributed to Berkeley by
6*45761Sbostic * Computer Consoles Inc.
7*45761Sbostic *
8*45761Sbostic * %sccs.include.redist.c%
9*45761Sbostic *
10*45761Sbostic *	@(#)Kfrexpd.s	7.1 (Berkeley) 12/06/90
11*45761Sbostic */
1225664Ssam
1325693Ssam#include "../tahoe/SYS.h"
1425664Ssam
1524138Ssam	.text
1625664SsamENTRY(Kfrexpd, 0)
1724138Ssam	subl3	$60,fp,sp
1824138Ssam	clrl	-60(fp)
1924138Ssam	clrl	-56(fp)
2024138Ssam	tstl	4(fp)
2125664Ssam	jgeq	1f
2224138Ssam	lnd	4(fp)
2324138Ssam	std	4(fp)
2424138Ssam	movl	$1,-56(fp)
2525664Ssam1:
2625664Ssam	cmpd2	4(fp),one
2725664Ssam	jleq	1f
2825664Ssam2:
2925664Ssam	cmpd2	4(fp),one
3025664Ssam	jleq	3f
3124138Ssam	addl2	$1,-60(fp)
3224138Ssam	pushl	16(fp)		# hfs
3325664Ssam	pushl	two+4		# ldd	2.0
3425664Ssam	pushl	two
3524138Ssam	pushl	8(fp)
3624138Ssam	pushl	4(fp)		# acc
3724138Ssam	callf	$24,_Kdivd
3824138Ssam	ldd	r0
3924138Ssam	std	4(fp)
4025664Ssam	jbr	2b
4125664Ssam1:	cmpd2	4(fp),half
4225664Ssam	jlss	2f
4325664Ssam	jbr	3f
4425664Ssam0:
4524138Ssam	subl2	$1,-60(fp)
4624138Ssam	pushl	16(fp)		# hfs
4725664Ssam	ldd	two; pushd	# 2.0
4825664Ssam	ldd	4(fp); pushd	# acc
4924138Ssam	callf	$24,_Kmuld
5024138Ssam	ldd	r0
5124138Ssam	std	4(fp)
5225664Ssam2:
5325664Ssam	cmpd2	4(fp),half
5425664Ssam	jlss	0b
5525664Ssam3:	movl	-60(fp),*12(fp)
5624138Ssam	tstl	-56(fp)
5725664Ssam	jeql	1f
5824138Ssam	lnd	4(fp)
5924138Ssam	std	4(fp)
6025664Ssam1:
6125664Ssam	movl	8(fp),r1
6224138Ssam	movl	4(fp),r0
6324138Ssam	ret
6425664Ssam	.data
6525664Ssam	.align 2
6625664Ssamone:	.long	0x40800000, 0x00000000 # .double 1
6725664Ssamtwo:	.long	0x41000000, 0x00000000 # .double 2
6825664Ssamhalf:	.long	0x40000000, 0x00000000 # .double 0.5
69