home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib25.zoo / libgcc1.c < prev    next >
C/C++ Source or Header  |  1992-06-01  |  4KB  |  252 lines

  1. #ifndef SItype
  2. #define SItype long int
  3. #endif
  4.  
  5. #ifndef FLOAT_VALUE_TYPE  
  6. #define FLOAT_VALUE_TYPE long int
  7. #endif
  8.  
  9. #ifndef INTIFY
  10. #define INTIFY(FLOATVAL)  (intify.f = (FLOATVAL), intify.i)
  11. #endif
  12.  
  13. #ifndef FLOATIFY
  14. #define FLOATIFY(INTVAL)  ((INTVAL).f)
  15. #endif
  16.  
  17. #ifndef FLOAT_ARG_TYPE
  18. #define FLOAT_ARG_TYPE union flt_or_int
  19. #endif
  20.  
  21. union flt_or_value { FLOAT_VALUE_TYPE i; float f; };
  22.  
  23. union flt_or_int { long int i; float f; };
  24.  
  25. #ifndef perform_lshrsi3
  26. #define perform_lshrsi3(a, b) return a >> b
  27. #endif
  28.  
  29. #ifndef perform_lshlsi3
  30. #define perform_lshlsi3(a, b) return a << b
  31. #endif
  32.  
  33. #ifndef perform_ashrsi3
  34. #define perform_ashrsi3(a, b) return a >> b
  35. #endif
  36.  
  37. #ifndef perform_ashlsi3
  38. #define perform_ashlsi3(a, b) return a << b
  39. #endif
  40.  
  41. #ifndef perform_fixsfsi
  42. #define perform_fixsfsi(a) return (SItype) a
  43. #endif
  44.  
  45. #ifndef perform_floatsisf
  46. #define perform_floatsisf(a)  return INTIFY ((float) a)
  47. #endif
  48.  
  49. /* Note that eqdf2 returns a value for "true" that is == 0,
  50.    nedf2 returns a value for "true" that is != 0,
  51.    gtdf2 returns a value for "true" that is > 0,
  52.    and so on.  */
  53.  
  54. #ifndef perform_eqdf2
  55. #define perform_eqdf2(a, b) return !(a == b)
  56. #endif
  57.  
  58. #ifndef perform_nedf2
  59. #define perform_nedf2(a, b) return a != b
  60. #endif
  61.  
  62. #ifndef perform_gtdf2
  63. #define perform_gtdf2(a, b) return a > b
  64. #endif
  65.  
  66. #ifndef perform_gedf2
  67. #define perform_gedf2(a, b) return (a >= b) - 1
  68. #endif
  69.  
  70. #ifndef perform_ltdf2
  71. #define perform_ltdf2(a, b) return -(a < b)
  72. #endif
  73.  
  74. #ifndef perform_ledf2
  75. #define perform_ledf2(a, b) return 1 - (a <= b)
  76. #endif
  77.  
  78. #ifndef perform_eqsf2
  79. #define perform_eqsf2(a, b) return !(a == b)
  80. #endif
  81.  
  82. #ifndef perform_nesf2
  83. #define perform_nesf2(a, b) return a != b
  84. #endif
  85.  
  86. #ifndef perform_gtsf2
  87. #define perform_gtsf2(a, b) return a > b
  88. #endif
  89.  
  90. #ifndef perform_gesf2
  91. #define perform_gesf2(a, b) return (a >= b) - 1
  92. #endif
  93.  
  94. #ifndef perform_ltsf2
  95. #define perform_ltsf2(a, b) return -(a < b)
  96. #endif
  97.  
  98. #ifndef perform_lesf2
  99. #define perform_lesf2(a, b) return 1 - (a <= b);
  100. #endif
  101.  
  102. SItype
  103. __lshrsi3 (a, b)
  104.      unsigned SItype a, b;
  105. {
  106.   perform_lshrsi3 (a, b);
  107. }
  108.  
  109. SItype
  110. __lshlsi3 (a, b)
  111.      unsigned SItype a, b;
  112. {
  113.   perform_lshlsi3 (a, b);
  114. }
  115.  
  116. SItype
  117. __ashrsi3 (a, b)
  118.      SItype a, b;
  119. {
  120.   perform_ashrsi3 (a, b);
  121. }
  122.  
  123. SItype
  124. __ashlsi3 (a, b)
  125.      SItype a, b;
  126. {
  127.   perform_ashlsi3 (a, b);
  128. }
  129.  
  130. /* Note that eqdf2 returns a value for "true" that is == 0,
  131.    nedf2 returns a value for "true" that is != 0,
  132.    gtdf2 returns a value for "true" that is > 0,
  133.    and so on.  */
  134.  
  135. SItype
  136. __eqdf2 (a, b)
  137.      double a, b;
  138. {
  139.   /* Value == 0 iff a == b.  */
  140.   perform_eqdf2 (a, b);
  141. }
  142.  
  143. SItype
  144. __nedf2 (a, b)
  145.      double a, b;
  146. {
  147.   /* Value != 0 iff a != b.  */
  148.   perform_nedf2 (a, b);
  149. }
  150.  
  151. SItype
  152. __gtdf2 (a, b)
  153.      double a, b;
  154. {
  155.   /* Value > 0 iff a > b.  */
  156.   perform_gtdf2 (a, b);
  157. }
  158.  
  159. SItype
  160. __gedf2 (a, b)
  161.      double a, b;
  162. {
  163.   /* Value >= 0 iff a >= b.  */
  164.   perform_gedf2 (a, b);
  165. }
  166.  
  167. SItype
  168. __ltdf2 (a, b)
  169.      double a, b;
  170. {
  171.   /* Value < 0 iff a < b.  */
  172.   perform_ltdf2 (a, b);
  173. }
  174.  
  175. SItype
  176. __ledf2 (a, b)
  177.      double a, b;
  178. {
  179.   /* Value <= 0 iff a <= b.  */
  180.   perform_ledf2 (a, b);
  181. }
  182.  
  183. SItype
  184. __fixsfsi (a)
  185.      FLOAT_ARG_TYPE a;
  186. {
  187.   union flt_or_value intify;
  188.   perform_fixsfsi (FLOATIFY (a));
  189. }
  190.  
  191. FLOAT_VALUE_TYPE
  192. __floatsisf (a)
  193.      SItype a;
  194. {
  195.   union flt_or_value intify;
  196.   perform_floatsisf (a);
  197. }
  198.  
  199. SItype
  200. __eqsf2 (a, b)
  201.      FLOAT_ARG_TYPE a, b;
  202. {
  203.   union flt_or_int intify;
  204.   /* Value == 0 iff a == b.  */
  205.   perform_eqsf2 (FLOATIFY (a), FLOATIFY (b));
  206. }
  207.  
  208. SItype
  209. __nesf2 (a, b)
  210.      FLOAT_ARG_TYPE a, b;
  211. {
  212.   union flt_or_int intify;
  213.   /* Value != 0 iff a != b.  */
  214.   perform_nesf2 (FLOATIFY (a), FLOATIFY (b));
  215. }
  216.  
  217. SItype
  218. __gtsf2 (a, b)
  219.      FLOAT_ARG_TYPE a, b;
  220. {
  221.   union flt_or_int intify;
  222.   /* Value > 0 iff a > b.  */
  223.   perform_gtsf2 (FLOATIFY (a), FLOATIFY (b));
  224. }
  225.  
  226. SItype
  227. __gesf2 (a, b)
  228.      FLOAT_ARG_TYPE a, b;
  229. {
  230.   union flt_or_int intify;
  231.   /* Value >= 0 iff a >= b.  */
  232.   perform_gesf2 (FLOATIFY (a), FLOATIFY (b));
  233. }
  234.  
  235. SItype
  236. __ltsf2 (a, b)
  237.      FLOAT_ARG_TYPE a, b;
  238. {
  239.   union flt_or_int intify;
  240.   /* Value < 0 iff a < b.  */
  241.   perform_ltsf2 (FLOATIFY (a), FLOATIFY (b));
  242. }
  243.  
  244. SItype
  245. __lesf2 (a, b)
  246.      FLOAT_ARG_TYPE a, b;
  247. {
  248.   union flt_or_int intify;
  249.   /* Value <= 0 iff a <= b.  */
  250.   perform_lesf2 (FLOATIFY (a), FLOATIFY (b));
  251. }
  252.