root / target-arm / nwfpe / ARM-gcc.h @ 1d6e34fd
History | View | Annotate | Download (4.4 kB)
1 | 00406dff | bellard | /*
|
---|---|---|---|
2 | 00406dff | bellard | -------------------------------------------------------------------------------
|
3 | 00406dff | bellard | The macro `BITS64' can be defined to indicate that 64-bit integer types are
|
4 | 00406dff | bellard | supported by the compiler.
|
5 | 00406dff | bellard | -------------------------------------------------------------------------------
|
6 | 00406dff | bellard | */
|
7 | 00406dff | bellard | #define BITS64
|
8 | 00406dff | bellard | |
9 | 00406dff | bellard | /*
|
10 | 00406dff | bellard | -------------------------------------------------------------------------------
|
11 | 00406dff | bellard | Each of the following `typedef's defines the most convenient type that holds
|
12 | 00406dff | bellard | integers of at least as many bits as specified. For example, `uint8' should
|
13 | 00406dff | bellard | be the most convenient type that can hold unsigned integers of as many as
|
14 | 00406dff | bellard | 8 bits. The `flag' type must be able to hold either a 0 or 1. For most
|
15 | 00406dff | bellard | implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
|
16 | 00406dff | bellard | to the same as `int'.
|
17 | 00406dff | bellard | -------------------------------------------------------------------------------
|
18 | 00406dff | bellard | */
|
19 | 00406dff | bellard | typedef char flag; |
20 | 00406dff | bellard | typedef unsigned char uint8; |
21 | 00406dff | bellard | typedef signed char int8; |
22 | 00406dff | bellard | typedef int uint16; |
23 | 00406dff | bellard | typedef int int16; |
24 | 00406dff | bellard | typedef unsigned int uint32; |
25 | 00406dff | bellard | typedef signed int int32; |
26 | 00406dff | bellard | #ifdef BITS64
|
27 | 00406dff | bellard | typedef unsigned long long int bits64; |
28 | 00406dff | bellard | typedef signed long long int sbits64; |
29 | 00406dff | bellard | #endif
|
30 | 00406dff | bellard | |
31 | 00406dff | bellard | /*
|
32 | 00406dff | bellard | -------------------------------------------------------------------------------
|
33 | 00406dff | bellard | Each of the following `typedef's defines a type that holds integers
|
34 | 00406dff | bellard | of _exactly_ the number of bits specified. For instance, for most
|
35 | 00406dff | bellard | implementation of C, `bits16' and `sbits16' should be `typedef'ed to
|
36 | 00406dff | bellard | `unsigned short int' and `signed short int' (or `short int'), respectively.
|
37 | 00406dff | bellard | -------------------------------------------------------------------------------
|
38 | 00406dff | bellard | */
|
39 | 00406dff | bellard | typedef unsigned char bits8; |
40 | 00406dff | bellard | typedef signed char sbits8; |
41 | 00406dff | bellard | typedef unsigned short int bits16; |
42 | 00406dff | bellard | typedef signed short int sbits16; |
43 | 00406dff | bellard | typedef unsigned int bits32; |
44 | 00406dff | bellard | typedef signed int sbits32; |
45 | 00406dff | bellard | #ifdef BITS64
|
46 | 00406dff | bellard | typedef unsigned long long int uint64; |
47 | 00406dff | bellard | typedef signed long long int int64; |
48 | 00406dff | bellard | #endif
|
49 | 00406dff | bellard | |
50 | 00406dff | bellard | #ifdef BITS64
|
51 | 00406dff | bellard | /*
|
52 | 00406dff | bellard | -------------------------------------------------------------------------------
|
53 | 00406dff | bellard | The `LIT64' macro takes as its argument a textual integer literal and if
|
54 | 00406dff | bellard | necessary ``marks'' the literal as having a 64-bit integer type. For
|
55 | 00406dff | bellard | example, the Gnu C Compiler (`gcc') requires that 64-bit literals be
|
56 | 00406dff | bellard | appended with the letters `LL' standing for `long long', which is `gcc's
|
57 | 00406dff | bellard | name for the 64-bit integer type. Some compilers may allow `LIT64' to be
|
58 | 00406dff | bellard | defined as the identity macro: `#define LIT64( a ) a'.
|
59 | 00406dff | bellard | -------------------------------------------------------------------------------
|
60 | 00406dff | bellard | */
|
61 | 00406dff | bellard | #define LIT64( a ) a##LL |
62 | 00406dff | bellard | #endif
|
63 | 00406dff | bellard | |
64 | 00406dff | bellard | /*
|
65 | 00406dff | bellard | -------------------------------------------------------------------------------
|
66 | 00406dff | bellard | The macro `INLINE' can be used before functions that should be inlined. If
|
67 | 00406dff | bellard | a compiler does not support explicit inlining, this macro should be defined
|
68 | 00406dff | bellard | to be `static'.
|
69 | 00406dff | bellard | -------------------------------------------------------------------------------
|
70 | 00406dff | bellard | */
|
71 | 00406dff | bellard | #define INLINE extern __inline__ |
72 | 00406dff | bellard | |
73 | 00406dff | bellard | |
74 | 00406dff | bellard | /* For use as a GCC soft-float library we need some special function names. */
|
75 | 00406dff | bellard | |
76 | 00406dff | bellard | #ifdef __LIBFLOAT__
|
77 | 00406dff | bellard | |
78 | 00406dff | bellard | /* Some 32-bit ops can be mapped straight across by just changing the name. */
|
79 | 00406dff | bellard | #define float32_add __addsf3
|
80 | 00406dff | bellard | #define float32_sub __subsf3
|
81 | 00406dff | bellard | #define float32_mul __mulsf3
|
82 | 00406dff | bellard | #define float32_div __divsf3
|
83 | 00406dff | bellard | #define int32_to_float32 __floatsisf
|
84 | 00406dff | bellard | #define float32_to_int32_round_to_zero __fixsfsi
|
85 | 00406dff | bellard | #define float32_to_uint32_round_to_zero __fixunssfsi
|
86 | 00406dff | bellard | |
87 | 00406dff | bellard | /* These ones go through the glue code. To avoid namespace pollution
|
88 | 00406dff | bellard | we rename the internal functions too. */
|
89 | 00406dff | bellard | #define float32_eq ___float32_eq
|
90 | 00406dff | bellard | #define float32_le ___float32_le
|
91 | 00406dff | bellard | #define float32_lt ___float32_lt
|
92 | 00406dff | bellard | |
93 | 00406dff | bellard | /* All the 64-bit ops have to go through the glue, so we pull the same
|
94 | 00406dff | bellard | trick. */
|
95 | 00406dff | bellard | #define float64_add ___float64_add
|
96 | 00406dff | bellard | #define float64_sub ___float64_sub
|
97 | 00406dff | bellard | #define float64_mul ___float64_mul
|
98 | 00406dff | bellard | #define float64_div ___float64_div
|
99 | 00406dff | bellard | #define int32_to_float64 ___int32_to_float64
|
100 | 00406dff | bellard | #define float64_to_int32_round_to_zero ___float64_to_int32_round_to_zero
|
101 | 00406dff | bellard | #define float64_to_uint32_round_to_zero ___float64_to_uint32_round_to_zero
|
102 | 00406dff | bellard | #define float64_to_float32 ___float64_to_float32
|
103 | 00406dff | bellard | #define float32_to_float64 ___float32_to_float64
|
104 | 00406dff | bellard | #define float64_eq ___float64_eq
|
105 | 00406dff | bellard | #define float64_le ___float64_le
|
106 | 00406dff | bellard | #define float64_lt ___float64_lt
|
107 | 00406dff | bellard | |
108 | 00406dff | bellard | #if 0
|
109 | 00406dff | bellard | #define float64_add __adddf3
|
110 | 00406dff | bellard | #define float64_sub __subdf3
|
111 | 00406dff | bellard | #define float64_mul __muldf3
|
112 | 00406dff | bellard | #define float64_div __divdf3
|
113 | 00406dff | bellard | #define int32_to_float64 __floatsidf
|
114 | 00406dff | bellard | #define float64_to_int32_round_to_zero __fixdfsi
|
115 | 00406dff | bellard | #define float64_to_uint32_round_to_zero __fixunsdfsi
|
116 | 00406dff | bellard | #define float64_to_float32 __truncdfsf2
|
117 | 00406dff | bellard | #define float32_to_float64 __extendsfdf2
|
118 | 00406dff | bellard | #endif
|
119 | 00406dff | bellard | |
120 | 00406dff | bellard | #endif |