xref: /original-bsd/sys/tahoe/math/Kfp.h (revision a347db52)
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  *	@(#)Kfp.h	7.1 (Berkeley) 12/06/90
11  */
12 
13 /*
14  * Opcodes to be emulated by kernel software.
15  */
16 #define	CVLF	0x76
17 #define	CVLD	0x77
18 #define	CVFL	0x86
19 #define	CVDL	0x87
20 #define	LDFD	0x97
21 #define	CVDF	0xa6
22 #define	ADDF   	0xc6
23 #define	ADDD	0xc7
24 #define	SUBF	0xd6
25 #define	SUBD	0xd7
26 #define	MULF	0xe6
27 #define	MULD	0xe7
28 #define	DIVF	0xf6
29 #define	DIVD	0xf7
30 #define	SINF	0x05
31 #define	COSF	0x15
32 #define	ATANF	0x25
33 #define	LOGF	0x35
34 #define	SQRTF	0x45
35 #define	EXPF	0x55
36 
37 /* HFS bits:	*/
38 #define HFS_UNDF	0x008	/* float underflow */
39 #define HFS_OVF		0x004	/* float overflow */
40 
41 #define HFS_RANGE	0x8000	/* set u_error to ERANGE */
42 #define HFS_DOM		0x4000	/* set u_error to EDOM */
43 #define HFS_DIVZ	0x2000  /* divide by zero flag */
44 
45 /* destination types for the f.p. opcodes:	*/
46 #define LONG	01
47 #define FLOAT	02
48 #define	DOUBLE	03
49 
50 /* exceptions:	*/
51 #define OVF_EXC		0x003	/* floating overflow */
52 #define UNDF_EXC	0x004 	/* floating underflow */
53 #define DIV0_EXC	0x005	/* floating divide by 0 */
54