xref: /original-bsd/lib/libc/vax/gen/frexp.s (revision 7a8f01dc)
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 */
7
8#if defined(LIBC_SCCS) && !defined(lint)
9	.asciz "@(#)frexp.s	5.6 (Berkeley) 06/01/90"
10#endif /* LIBC_SCCS and not lint */
11
12/* C library -- frexp(value, eptr) */
13
14#include "DEFS.h"
15
16ENTRY(frexp, 0)
17	movd	4(ap),r0		# (r0,r1) := value
18	extzv	$7,$8,r0,*12(ap)	# Fetch exponent
19	jeql	1f			# If exponent zero, we're done
20	subl2	$128,*12(ap)		# Bias the exponent appropriately
21	insv	$128,$7,$8,r0		# Force result exponent to biased 0
221:
23	ret
24