[BACK]Return to fpu_status.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / pc532 / fpu

File: [cvs.NetBSD.org] / src / sys / arch / pc532 / fpu / Attic / fpu_status.h (download)

Revision 1.4, Fri Jan 23 04:12:39 2004 UTC (17 years, 1 month ago) by simonb
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, yamt-km-base4, yamt-km-base3, yamt-km-base2, yamt-km-base, yamt-km, thorpej-vnode-attr-base, thorpej-vnode-attr, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, ktrace-lwp-base, kent-audio2-base, kent-audio2, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-lazymbuf
Changes since 1.3: +5 -5 lines

Fix trailing white space and trailing blank line nits.

/*	$NetBSD: fpu_status.h,v 1.4 2004/01/23 04:12:39 simonb Exp $	*/

/*
 * IEEE floating point support for NS32081 and NS32381 fpus.
 * Copyright (c) 1995 Ian Dall
 * All Rights Reserved.
 *
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 *
 * IAN DALL ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
 * IAN DALL DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
 * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 */
/*
 *	File:	fpu_status.h
 *	Author:	Ian Dall
 *	Date:	November 1995
 *
 *	FPU status register definitions
 *
 * HISTORY
 * 14-Dec-95  Ian Dall (Ian.Dall@dsto.defence.gov.au)
 *	First release.
 *
 */

#ifndef _FPU_STATUS_H_
#define _FPU_STATUS_H_
/*
 * Control register
 */
#define FPC_RMB		0x00010000	/* register modify bit */
#define FPC_SWF		0x0000fe00	/* reserved for software */
#define FPC_RM		0x00000180	/* rounding mode */
#define FPC_RM_NEAREST	0x00000000	/* round to nearest */
#define FPC_RM_TOZERO	0x00000080	/* round towards zero */
#define FPC_RM_TOPOS	0x00000100	/* round towards +infinity */
#define FPC_RM_TONEG	0x00000180	/* round towards -infinity */
#define FPC_IF		0x00000040	/* inexact result flag */
#define FPC_IEN		0x00000020	/* inexact result trap enable */
#define FPC_UF		0x00000010	/* underflow flag (else 0) */
#define FPC_UEN		0x00000008	/* underflow trap enable */
#define FPC_TT		0x00000007	/* trap type mask */
#define FPC_TT_NONE	0x00000000	/* no exceptional condition */
#define FPC_TT_UNDFL	0x00000001	/* underflow */
#define FPC_TT_OVFL	0x00000002	/* overflow */
#define FPC_TT_DIV0	0x00000003	/* divide by zero */
#define FPC_TT_ILL	0x00000004	/* illegal instruction */
#define FPC_TT_INVOP	0x00000005	/* invalid operation */
#define FPC_TT_INEXACT	0x00000006	/* inexact result */
#define FPC_TT_UNKNOWN  0x00000007      /* Not a real trap type */

/* Bits in the SWF field used for software emulation */
#define FPC_OVE  0x200		/* Overflow enable */
#define FPC_OVF  0x400		/* Overflow flag */
#define FPC_IVE  0x800		/* Invalid enable */
#define FPC_IVF  0x1000		/* Invalid flag */
#define FPC_DZE  0x2000		/* Divide by zero enable */
#define FPC_DZF  0x4000		/* Divide by zero flag */
#define FPC_UNDE 0x8000		/* Soft Underflow enable, requires FPC_UEN */

#define GET_SET_FSR(val) ({						\
	int _tmp;							\
	asm volatile("sfsr %0; lfsr %1" : "=&g" (_tmp): "g" (val)); _tmp; \
})
#define GET_FSR() ({int _tmp; asm volatile("sfsr %0" : "=g" (_tmp)); _tmp;})
#define SET_FSR(val) ({asm volatile("lfsr %0" :: "g" (val));})

#endif /* _FPU_STATUS_H_ */