xref: /csrg-svn/lib/libc/vax/gen/frexp.s (revision 34819)
121425Sdist/*
221425Sdist * Copyright (c) 1980 Regents of the University of California.
334480Sbostic * All rights reserved.
434480Sbostic *
534480Sbostic * Redistribution and use in source and binary forms are permitted
6*34819Sbostic * provided that the above copyright notice and this paragraph are
7*34819Sbostic * duplicated in all such forms and that any documentation,
8*34819Sbostic * advertising materials, and other materials related to such
9*34819Sbostic * distribution and use acknowledge that the software was developed
10*34819Sbostic * by the University of California, Berkeley.  The name of the
11*34819Sbostic * University may not be used to endorse or promote products derived
12*34819Sbostic * from this software without specific prior written permission.
13*34819Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34819Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34819Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1621425Sdist */
1717000Sralph
18*34819Sbostic#if defined(LIBC_SCCS) && !defined(lint)
19*34819Sbostic	.asciz "@(#)frexp.s	5.5 (Berkeley) 06/27/88"
20*34819Sbostic#endif /* LIBC_SCCS and not lint */
2121425Sdist
2217000Sralph/* C library -- frexp(value, eptr) */
2317000Sralph
2417000Sralph#include "DEFS.h"
2517000Sralph
2617329SsamENTRY(frexp, 0)
2717000Sralph	movd	4(ap),r0		# (r0,r1) := value
2817000Sralph	extzv	$7,$8,r0,*12(ap)	# Fetch exponent
2917000Sralph	jeql	1f			# If exponent zero, we're done
3017000Sralph	subl2	$128,*12(ap)		# Bias the exponent appropriately
3117000Sralph	insv	$128,$7,$8,r0		# Force result exponent to biased 0
3217000Sralph1:
3317000Sralph	ret
34