xref: /original-bsd/sys/tahoe/math/FP.h (revision f3c03cba)
1 /*-
2  * Copyright (c) 1985 The 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  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)FP.h	7.1 (Berkeley) 12/06/90
11  */
12 
13 /*
14  * General definitions of the floating point stuff on Power 6/32.
15  * The floating point format definition is:
16  *
17  *		S    (exp-128)
18  *	    (-1)  * 2	       * F
19  *
20  *	Where exp is the exponent field and F is the binary
21  *	mantissa following it, including the hidden bit.
22  *	The hidden bit actually is 1/2, so F is known to
23  *	satisfy the range:
24  *		1/2 <= F < 1
25  */
26 
27 typedef struct {
28 	unsigned	sign:1;
29 	unsigned	exponent:8;
30 	unsigned	mantissa:23;
31 } sp_format;
32 
33 typedef struct {
34 	unsigned	sign:1;
35 	unsigned	exponent:8;
36 	unsigned	mantissa:23;
37 	unsigned	mantissa_lst;
38 } dp_format;
39 
40 #define	EXP_BIAS	128		/* Exponent bias */
41 #define SIGN_BIT	0x80000000	/* S bit mask */
42