|
|
1.1 root 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 distributed in the hope that it will be useful,
7: but WITHOUT ANY WARRANTY. No author or distributor
8: accepts responsibility to anyone for the consequences of using it
9: or for whether it serves any particular purpose or works at all,
10: unless he says so in writing. Refer to the GNU CC General Public
11: License for full details.
12:
13: Everyone is granted permission to copy, modify and redistribute
14: GNU CC, but only under the conditions described in the
15: GNU CC General Public License. A copy of this license is
16: supposed to have been given to you along with GNU CC so you
17: can know your rights and responsibilities. It should be in a
18: file named COPYING. Among other things, the copyright notice
19: and this notice must be preserved on all copies. */
20:
21: /* If we are not cross-compiling, use a `double' to represent the
22: floating-point value. Otherwise, use some other type
23: (probably a struct containing an array of longs). */
24: #ifndef REAL_VALUE_TYPE
25: #define REAL_VALUE_TYPE double
26: #else
27: #define REAL_IS_NOT_DOUBLE
28: #endif
29:
30: /* Compare two floating-point values for equality. */
31: #ifndef REAL_VALUES_EQUAL
32: #define REAL_VALUES_EQUAL(x,y) ((x) == (y))
33: #endif
34:
35: /* Compare two floating-point values for less than. */
36: #ifndef REAL_VALUES_LESS
37: #define REAL_VALUES_LESS(x,y) ((x) < (y))
38: #endif
39:
40: /* Scale X by Y powers of 2. */
41: #ifndef REAL_VALUE_LDEXP
42: #define REAL_VALUE_LDEXP(x,y) ldexp (x, y)
43: extern double ldexp ();
44: #endif
45:
46: /* Convert the string X to a floating-point value. */
47: #ifndef REAL_VALUE_ATOF
48: #define REAL_VALUE_ATOF(x) atof (x)
49: extern double atof ();
50: #endif
51:
52: /* Negate the floating-point value X. */
53: #ifndef REAL_VALUE_NEGATE
54: #define REAL_VALUE_NEGATE(x) (- (x))
55: #endif
56:
57: /* Truncate the floating-point value X to single-precision. */
58: #ifndef REAL_VALUE_TRUNCATE
59: #define REAL_VALUE_TRUNCATE(x) ((float) (x))
60: #endif
61:
62: /* Union type used for extracting real values from CONST_DOUBLEs
63: or putting them in. */
64:
65: union real_extract
66: {
67: REAL_VALUE_TYPE d;
68: int i[sizeof (REAL_VALUE_TYPE) / sizeof (int)];
69: };
70:
71: /* For a CONST_DOUBLE:
72: The usual two ints that hold the value.
73: For a DImode, that is all there are.
74: For a float, the number of ints varies,
75: so use &CONST_DOUBLE_LOW(r) as the address of an array of them. */
76: #define CONST_DOUBLE_LOW(r) XINT (r, 2)
77: #define CONST_DOUBLE_HIGH(r) XINT (r, 3)
78:
79: /* Link for chain of all CONST_DOUBLEs in use in current function. */
80: #define CONST_DOUBLE_CHAIN(r) XEXP (r, 1)
81: /* The MEM which represents this CONST_DOUBLE's value in memory,
82: or const0_rtx if no MEM has been made for it yet,
83: or cc0_rtx if it is not on the chain. */
84: #define CONST_DOUBLE_MEM(r) XEXP (r, 0)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.