xref: /original-bsd/lib/libc/hp300/gen/frexp.s (revision 5d07e70c)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * the Systems Programming Group of the University of Utah Computer
7 * Science Department.
8 *
9 * %sccs.include.redist.c%
10 */
11
12#if defined(LIBC_SCCS) && !defined(lint)
13	.asciz "@(#)frexp.s	5.1 (Berkeley) 05/12/90"
14#endif /* LIBC_SCCS and not lint */
15
16#include "DEFS.h"
17
18/*
19 * double frexp(val, eptr)
20 * returns: x s.t. val = x * (2 ** n), with n stored in *eptr
21 */
22ENTRY(frexp)
23	fmoved		sp@(4),fp1
24	fgetmanx	fp1,fp0
25	fgetexpx	fp1
26	fmovel		fp1,d0
27	addql		#1,d0
28	movel		sp@(12),a0
29	movel		d0,a0@
30	fdivl		#2,fp0
31	fmoved		fp0,sp@-
32	movel		sp@+,d0
33	movel		sp@+,d1
34	rts
35