ARM-gcc.h 4.4 KB

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