home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / g__src3 / real.h < prev    next >
C/C++ Source or Header  |  1993-07-23  |  3KB  |  84 lines

  1. /* Front-end tree definitions for GNU compiler.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* If we are not cross-compiling, use a `double' to represent the
  21.    floating-point value.  Otherwise, use some other type
  22.    (probably a struct containing an array of longs).  */
  23. #ifndef REAL_VALUE_TYPE
  24. #define REAL_VALUE_TYPE double
  25. #else
  26. #define REAL_IS_NOT_DOUBLE
  27. #endif
  28.  
  29. /* Compare two floating-point values for equality.  */
  30. #ifndef REAL_VALUES_EQUAL
  31. #define REAL_VALUES_EQUAL(x,y) ((x) == (y))
  32. #endif
  33.  
  34. /* Compare two floating-point values for less than.  */
  35. #ifndef REAL_VALUES_LESS
  36. #define REAL_VALUES_LESS(x,y) ((x) < (y))
  37. #endif
  38.  
  39. /* Scale X by Y powers of 2.  */
  40. #ifndef REAL_VALUE_LDEXP
  41. #define REAL_VALUE_LDEXP(x,y) ldexp (x, y)
  42. extern double ldexp ();
  43. #endif
  44.  
  45. /* Convert the string X to a floating-point value.  */
  46. #ifndef REAL_VALUE_ATOF
  47. #define REAL_VALUE_ATOF(x) atof (x)
  48. extern double atof ();
  49. #endif
  50.  
  51. /* Negate the floating-point value X.  */
  52. #ifndef REAL_VALUE_NEGATE
  53. #define REAL_VALUE_NEGATE(x) (- (x))
  54. #endif
  55.  
  56. /* Truncate the floating-point value X to single-precision.  */
  57. #ifndef REAL_VALUE_TRUNCATE
  58. #define REAL_VALUE_TRUNCATE(x) ((float) (x))
  59. #endif
  60.  
  61. /* Union type used for extracting real values from CONST_DOUBLEs
  62.    or putting them in.  */
  63.  
  64. union real_extract 
  65. {
  66.   REAL_VALUE_TYPE d;
  67.   int i[sizeof (REAL_VALUE_TYPE) / sizeof (int)];
  68. };
  69.  
  70. /* For a CONST_DOUBLE:
  71.    The usual two ints that hold the value.
  72.    For a DImode, that is all there are.
  73.    For a float, the number of ints varies,
  74.    so use &CONST_DOUBLE_LOW(r) as the address of an array of them.  */
  75. #define CONST_DOUBLE_LOW(r) XINT (r, 2)
  76. #define CONST_DOUBLE_HIGH(r) XINT (r, 3)
  77.  
  78. /* Link for chain of all CONST_DOUBLEs in use in current function.  */
  79. #define CONST_DOUBLE_CHAIN(r) XEXP (r, 1)
  80. /* The MEM which represents this CONST_DOUBLE's value in memory,
  81.    or const0_rtx if no MEM has been made for it yet,
  82.    or cc0_rtx if it is not on the chain.  */
  83. #define CONST_DOUBLE_MEM(r) XEXP (r, 0)
  84.