non-AT&T implementations of frexp.c in machine/gen/frexp.c
[unix-history] / usr / src / lib / libc / tahoe / fpe / negf.s
CommitLineData
1f0502d3
KB
1/*
2 * Copyright (c) 1986 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Computer Consoles Inc.
7 *
019bea33 8 * %sccs.include.redist.c%
1f0502d3
KB
9 */
10
11#if defined(SYSLIBC_SCCS) && !defined(lint)
019bea33 12 .asciz "@(#)negf.s 1.3 (Berkeley) %G%"
1f0502d3 13#endif /* SYSLIBC_SCCS and not lint */
b9f214cf
SL
14
15#include <tahoemath/fp.h>
16#include "DEFS.h"
17
18XENTRY(negf, 0)
19 clrl r1
20 andl3 $EXPMASK,4(fp),r0 /* check for reserved operand,zero. */
21 beql isreserved
22 movl 4(fp),r0 /* fetch operand. */
23 bbc $31,r0,seton
24 andl2 $(0!SIGNBIT),r0 /* turn it off. */
25 ret
26seton: orl2 $SIGNBIT,r0 /* turn it on. */
27 ret
28isreserved:
29 bbc $31,4(fp),retzero
30 callf $4,sfpresop
31 ret
32retzero:
33 clrl r0
34 ret