xref: /csrg-svn/lib/libc/vax/gen/frexp.s (revision 34480)
121425Sdist/*
221425Sdist * Copyright (c) 1980 Regents of the University of California.
3*34480Sbostic * All rights reserved.
4*34480Sbostic *
5*34480Sbostic * Redistribution and use in source and binary forms are permitted
6*34480Sbostic * provided that this notice is preserved and that due credit is given
7*34480Sbostic * to the University of California at Berkeley. The name of the University
8*34480Sbostic * may not be used to endorse or promote products derived from this
9*34480Sbostic * software without specific written prior permission. This software
10*34480Sbostic * is provided ``as is'' without express or implied warranty.
1121425Sdist */
1217000Sralph
13*34480Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
14*34480Sbostic_sccsid:.asciz	"@(#)frexp.s	5.4 (Berkeley) 05/25/88"
15*34480Sbostic#endif /* SYSLIBC_SCCS and not lint */
1621425Sdist
1717000Sralph/* C library -- frexp(value, eptr) */
1817000Sralph
1917000Sralph#include "DEFS.h"
2017000Sralph
2117329SsamENTRY(frexp, 0)
2217000Sralph	movd	4(ap),r0		# (r0,r1) := value
2317000Sralph	extzv	$7,$8,r0,*12(ap)	# Fetch exponent
2417000Sralph	jeql	1f			# If exponent zero, we're done
2517000Sralph	subl2	$128,*12(ap)		# Bias the exponent appropriately
2617000Sralph	insv	$128,$7,$8,r0		# Force result exponent to biased 0
2717000Sralph1:
2817000Sralph	ret
29