xref: /openbsd-src/lib/libc/arch/sh/softfloat/sh-gcc.h (revision 31c9e1db15330881ab14606d7b68a1a068378053)
1*31c9e1dbSdrahn /*	$OpenBSD: sh-gcc.h,v 1.1 2006/11/07 14:07:13 drahn Exp $	*/
2*31c9e1dbSdrahn 
3*31c9e1dbSdrahn /*
4*31c9e1dbSdrahn -------------------------------------------------------------------------------
5*31c9e1dbSdrahn One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
6*31c9e1dbSdrahn -------------------------------------------------------------------------------
7*31c9e1dbSdrahn */
8*31c9e1dbSdrahn #define LITTLEENDIAN
9*31c9e1dbSdrahn 
10*31c9e1dbSdrahn /*
11*31c9e1dbSdrahn -------------------------------------------------------------------------------
12*31c9e1dbSdrahn The macro `BITS64' can be defined to indicate that 64-bit integer types are
13*31c9e1dbSdrahn supported by the compiler.
14*31c9e1dbSdrahn -------------------------------------------------------------------------------
15*31c9e1dbSdrahn */
16*31c9e1dbSdrahn #define BITS64
17*31c9e1dbSdrahn 
18*31c9e1dbSdrahn /*
19*31c9e1dbSdrahn -------------------------------------------------------------------------------
20*31c9e1dbSdrahn Each of the following `typedef's defines the most convenient type that holds
21*31c9e1dbSdrahn integers of at least as many bits as specified.  For example, `uint8' should
22*31c9e1dbSdrahn be the most convenient type that can hold unsigned integers of as many as
23*31c9e1dbSdrahn 8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
24*31c9e1dbSdrahn implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
25*31c9e1dbSdrahn to the same as `int'.
26*31c9e1dbSdrahn -------------------------------------------------------------------------------
27*31c9e1dbSdrahn */
28*31c9e1dbSdrahn typedef int flag;
29*31c9e1dbSdrahn typedef int uint8;
30*31c9e1dbSdrahn typedef int int8;
31*31c9e1dbSdrahn typedef int uint16;
32*31c9e1dbSdrahn typedef int int16;
33*31c9e1dbSdrahn typedef unsigned int uint32;
34*31c9e1dbSdrahn typedef signed int int32;
35*31c9e1dbSdrahn #ifdef BITS64
36*31c9e1dbSdrahn typedef unsigned long long int uint64;
37*31c9e1dbSdrahn typedef signed long long int int64;
38*31c9e1dbSdrahn #endif
39*31c9e1dbSdrahn 
40*31c9e1dbSdrahn /*
41*31c9e1dbSdrahn -------------------------------------------------------------------------------
42*31c9e1dbSdrahn Each of the following `typedef's defines a type that holds integers
43*31c9e1dbSdrahn of _exactly_ the number of bits specified.  For instance, for most
44*31c9e1dbSdrahn implementation of C, `bits16' and `sbits16' should be `typedef'ed to
45*31c9e1dbSdrahn `unsigned short int' and `signed short int' (or `short int'), respectively.
46*31c9e1dbSdrahn -------------------------------------------------------------------------------
47*31c9e1dbSdrahn */
48*31c9e1dbSdrahn typedef unsigned char bits8;
49*31c9e1dbSdrahn typedef signed char sbits8;
50*31c9e1dbSdrahn typedef unsigned short int bits16;
51*31c9e1dbSdrahn typedef signed short int sbits16;
52*31c9e1dbSdrahn typedef unsigned int bits32;
53*31c9e1dbSdrahn typedef signed int sbits32;
54*31c9e1dbSdrahn #ifdef BITS64
55*31c9e1dbSdrahn typedef unsigned long long int bits64;
56*31c9e1dbSdrahn typedef signed long long int sbits64;
57*31c9e1dbSdrahn #endif
58*31c9e1dbSdrahn 
59*31c9e1dbSdrahn #ifdef BITS64
60*31c9e1dbSdrahn /*
61*31c9e1dbSdrahn -------------------------------------------------------------------------------
62*31c9e1dbSdrahn The `LIT64' macro takes as its argument a textual integer literal and
63*31c9e1dbSdrahn if necessary ``marks'' the literal as having a 64-bit integer type.
64*31c9e1dbSdrahn For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
65*31c9e1dbSdrahn appended with the letters `LL' standing for `long long', which is `gcc's
66*31c9e1dbSdrahn name for the 64-bit integer type.  Some compilers may allow `LIT64' to be
67*31c9e1dbSdrahn defined as the identity macro:  `#define LIT64( a ) a'.
68*31c9e1dbSdrahn -------------------------------------------------------------------------------
69*31c9e1dbSdrahn */
70*31c9e1dbSdrahn #define LIT64( a ) a##LL
71*31c9e1dbSdrahn #endif
72*31c9e1dbSdrahn 
73*31c9e1dbSdrahn /*
74*31c9e1dbSdrahn -------------------------------------------------------------------------------
75*31c9e1dbSdrahn The macro `INLINE' can be used before functions that should be inlined.  If
76*31c9e1dbSdrahn a compiler does not support explicit inlining, this macro should be defined
77*31c9e1dbSdrahn to be `static'.
78*31c9e1dbSdrahn -------------------------------------------------------------------------------
79*31c9e1dbSdrahn */
80*31c9e1dbSdrahn #define INLINE static __inline
81*31c9e1dbSdrahn 
82*31c9e1dbSdrahn /*
83*31c9e1dbSdrahn -------------------------------------------------------------------------------
84*31c9e1dbSdrahn Sh FPU is sane
85*31c9e1dbSdrahn -------------------------------------------------------------------------------
86*31c9e1dbSdrahn */
87*31c9e1dbSdrahn #define FLOAT64_DEMANGLE(a)	(a)
88*31c9e1dbSdrahn #define FLOAT64_MANGLE(a)	(a)
89