diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2006-11-07 14:07:14 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2006-11-07 14:07:14 +0000 |
commit | 9a9db48f90ec801101f1b3dde0e054240c47eb79 (patch) | |
tree | 007c704cd79ad00bce350545ead5ec7db488e9ff /lib/libc | |
parent | dd4f7e3738c415b440063b954c2976625791e5d5 (diff) |
forgot to commit the new files for sh softfloat support.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/arch/sh/softfloat/Makefile.inc | 10 | ||||
-rw-r--r-- | lib/libc/arch/sh/softfloat/milieu.h | 49 | ||||
-rw-r--r-- | lib/libc/arch/sh/softfloat/sh-gcc.h | 88 |
3 files changed, 147 insertions, 0 deletions
diff --git a/lib/libc/arch/sh/softfloat/Makefile.inc b/lib/libc/arch/sh/softfloat/Makefile.inc new file mode 100644 index 00000000000..c945a737796 --- /dev/null +++ b/lib/libc/arch/sh/softfloat/Makefile.inc @@ -0,0 +1,10 @@ +# $OpenBSD: Makefile.inc,v 1.1 2006/11/07 14:07:13 drahn Exp $ +SRCS += eqdf2.c eqsf2.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c +SRCS += fpsetround.c fpsetsticky.c gedf2.c gesf2.c gtdf2.c gtsf2.c ledf2.c +SRCS += lesf2.c ltdf2.c ltsf2.c nedf2.c negdf2.c negsf2.c nesf2.c +#SRCS += timesoftfloat.c +SRCS += unorddf2.c unordsf2.c +SRCS += softfloat.c +CFLAGS += -DSOFTFLOAT_FOR_GCC + +.PATH: ${.CURDIR}/softfloat diff --git a/lib/libc/arch/sh/softfloat/milieu.h b/lib/libc/arch/sh/softfloat/milieu.h new file mode 100644 index 00000000000..3724ccae1d9 --- /dev/null +++ b/lib/libc/arch/sh/softfloat/milieu.h @@ -0,0 +1,49 @@ +/* $OpenBSD: milieu.h,v 1.1 2006/11/07 14:07:13 drahn Exp $ */ +/* $NetBSD: milieu.h,v 1.1 2000/12/29 20:13:54 bjh21 Exp $ */ + +/* +=============================================================================== + +This C header file is part of the SoftFloat IEC/IEEE Floating-point +Arithmetic Package, Release 2a. + +Written by John R. Hauser. This work was made possible in part by the +International Computer Science Institute, located at Suite 600, 1947 Center +Street, Berkeley, California 94704. Funding was partially provided by the +National Science Foundation under grant MIP-9311980. The original version +of this code was written as part of a project to build a fixed-point vector +processor in collaboration with the University of California at Berkeley, +overseen by Profs. Nelson Morgan and John Wawrzynek. More information +is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/ +arithmetic/SoftFloat.html'. + +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY +AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. + +Derivative works are acceptable, even for commercial purposes, so long as +(1) they include prominent notice that the work is derivative, and (2) they +include prominent notice akin to these four paragraphs for those parts of +this code that are retained. + +=============================================================================== +*/ + +/* +------------------------------------------------------------------------------- +Include common integer types and flags. +------------------------------------------------------------------------------- +*/ +#include "sh-gcc.h" + +/* +------------------------------------------------------------------------------- +Symbolic Boolean literals. +------------------------------------------------------------------------------- +*/ +enum { + FALSE = 0, + TRUE = 1 +}; diff --git a/lib/libc/arch/sh/softfloat/sh-gcc.h b/lib/libc/arch/sh/softfloat/sh-gcc.h new file mode 100644 index 00000000000..9b529399222 --- /dev/null +++ b/lib/libc/arch/sh/softfloat/sh-gcc.h @@ -0,0 +1,88 @@ +/* $OpenBSD: sh-gcc.h,v 1.1 2006/11/07 14:07:13 drahn Exp $ */ + +/* +------------------------------------------------------------------------------- +One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. +------------------------------------------------------------------------------- +*/ +#define LITTLEENDIAN + +/* +------------------------------------------------------------------------------- +The macro `BITS64' can be defined to indicate that 64-bit integer types are +supported by the compiler. +------------------------------------------------------------------------------- +*/ +#define BITS64 + +/* +------------------------------------------------------------------------------- +Each of the following `typedef's defines the most convenient type that holds +integers of at least as many bits as specified. For example, `uint8' should +be the most convenient type that can hold unsigned integers of as many as +8 bits. The `flag' type must be able to hold either a 0 or 1. For most +implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed +to the same as `int'. +------------------------------------------------------------------------------- +*/ +typedef int flag; +typedef int uint8; +typedef int int8; +typedef int uint16; +typedef int int16; +typedef unsigned int uint32; +typedef signed int int32; +#ifdef BITS64 +typedef unsigned long long int uint64; +typedef signed long long int int64; +#endif + +/* +------------------------------------------------------------------------------- +Each of the following `typedef's defines a type that holds integers +of _exactly_ the number of bits specified. For instance, for most +implementation of C, `bits16' and `sbits16' should be `typedef'ed to +`unsigned short int' and `signed short int' (or `short int'), respectively. +------------------------------------------------------------------------------- +*/ +typedef unsigned char bits8; +typedef signed char sbits8; +typedef unsigned short int bits16; +typedef signed short int sbits16; +typedef unsigned int bits32; +typedef signed int sbits32; +#ifdef BITS64 +typedef unsigned long long int bits64; +typedef signed long long int sbits64; +#endif + +#ifdef BITS64 +/* +------------------------------------------------------------------------------- +The `LIT64' macro takes as its argument a textual integer literal and +if necessary ``marks'' the literal as having a 64-bit integer type. +For example, the GNU C Compiler (`gcc') requires that 64-bit literals be +appended with the letters `LL' standing for `long long', which is `gcc's +name for the 64-bit integer type. Some compilers may allow `LIT64' to be +defined as the identity macro: `#define LIT64( a ) a'. +------------------------------------------------------------------------------- +*/ +#define LIT64( a ) a##LL +#endif + +/* +------------------------------------------------------------------------------- +The macro `INLINE' can be used before functions that should be inlined. If +a compiler does not support explicit inlining, this macro should be defined +to be `static'. +------------------------------------------------------------------------------- +*/ +#define INLINE static __inline + +/* +------------------------------------------------------------------------------- +Sh FPU is sane +------------------------------------------------------------------------------- +*/ +#define FLOAT64_DEMANGLE(a) (a) +#define FLOAT64_MANGLE(a) (a) |