xref: /csrg-svn/sys/tahoe/math/Kfp.h (revision 45761)
1*45761Sbostic /*-
2*45761Sbostic  * Copyright (c) 1985 The Regents of the University of California.
3*45761Sbostic  * All rights reserved.
4*45761Sbostic  *
5*45761Sbostic  * This code is derived from software contributed to Berkeley by
6*45761Sbostic  * Computer Consoles Inc.
7*45761Sbostic  *
8*45761Sbostic  * %sccs.include.redist.c%
9*45761Sbostic  *
10*45761Sbostic  *	@(#)Kfp.h	7.1 (Berkeley) 12/06/90
11*45761Sbostic  */
1225664Ssam 
1325664Ssam /*
1425664Ssam  * Opcodes to be emulated by kernel software.
1525664Ssam  */
1624116Ssam #define	CVLF	0x76
1724116Ssam #define	CVLD	0x77
1824116Ssam #define	CVFL	0x86
1924116Ssam #define	CVDL	0x87
2024116Ssam #define	LDFD	0x97
2124116Ssam #define	CVDF	0xa6
2224116Ssam #define	ADDF   	0xc6
2324116Ssam #define	ADDD	0xc7
2424116Ssam #define	SUBF	0xd6
2524116Ssam #define	SUBD	0xd7
2624116Ssam #define	MULF	0xe6
2724116Ssam #define	MULD	0xe7
2824116Ssam #define	DIVF	0xf6
2924116Ssam #define	DIVD	0xf7
3024116Ssam #define	SINF	0x05
3124116Ssam #define	COSF	0x15
3224116Ssam #define	ATANF	0x25
3324116Ssam #define	LOGF	0x35
3424116Ssam #define	SQRTF	0x45
3524116Ssam #define	EXPF	0x55
3624116Ssam 
3724116Ssam /* HFS bits:	*/
3824116Ssam #define HFS_UNDF	0x008	/* float underflow */
3924116Ssam #define HFS_OVF		0x004	/* float overflow */
4024116Ssam 
4124116Ssam #define HFS_RANGE	0x8000	/* set u_error to ERANGE */
4224116Ssam #define HFS_DOM		0x4000	/* set u_error to EDOM */
4324116Ssam #define HFS_DIVZ	0x2000  /* divide by zero flag */
4424116Ssam 
4524116Ssam /* destination types for the f.p. opcodes:	*/
4624116Ssam #define LONG	01
4724116Ssam #define FLOAT	02
4824116Ssam #define	DOUBLE	03
4924116Ssam 
5024116Ssam /* exceptions:	*/
5124116Ssam #define OVF_EXC		0x003	/* floating overflow */
5224116Ssam #define UNDF_EXC	0x004 	/* floating underflow */
5324116Ssam #define DIV0_EXC	0x005	/* floating divide by 0 */
54