Changeset 1391 for branches/GNU/src/gcc/gcc/gengenrtl.c
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (21 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 dir.info 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/gcc
- Property svn:ignore
-
old new 1 genrtl2 genrtl.h3 genrtl.c4 1 c-parse.y 5 2 c-parse.h 6 3 c-parse.c 7 4 tradcif.c 8 gcc.info*9 cpp.info*10 c-tree.info*11 cppinternals.info*12 5 cscope.files 13 6 cscope.out 7 cscope.in.out 8 cscope.po.out 9 gengtype-lex.c 10 gengtype-yacc.c 11 gengtype-yacc.h
-
- Property svn:ignore
-
branches/GNU/src/gcc/gcc/gengenrtl.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r1390 r1391 1 1 /* Generate code to allocate RTL structures. 2 Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.2 Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. 3 3 4 4 This file is part of GCC. … … 29 29 #include "real.h" 30 30 31 /* Calculate the format for CONST_DOUBLE. This depends on the relative 32 widths of HOST_WIDE_INT and REAL_VALUE_TYPE. 33 34 We need to go out to e0wwwww, since REAL_ARITHMETIC assumes 16-bits 35 per element in REAL_VALUE_TYPE. 36 37 This is duplicated in rtl.c. 38 39 A number of places assume that there are always at least two 'w' 40 slots in a CONST_DOUBLE, so we provide them even if one would suffice. */ 41 42 #ifdef REAL_ARITHMETIC 43 # if MAX_LONG_DOUBLE_TYPE_SIZE == 96 44 # define REAL_WIDTH \ 45 (11*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT 46 # else 47 # if MAX_LONG_DOUBLE_TYPE_SIZE == 128 48 # define REAL_WIDTH \ 49 (19*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT 50 # else 51 # if HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT 52 # define REAL_WIDTH \ 53 (7*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT 54 # endif 55 # endif 56 # endif 57 #endif /* REAL_ARITHMETIC */ 58 59 #ifndef REAL_WIDTH 60 # if HOST_BITS_PER_WIDE_INT*2 >= MAX_LONG_DOUBLE_TYPE_SIZE 61 # define REAL_WIDTH 2 62 # else 63 # if HOST_BITS_PER_WIDE_INT*3 >= MAX_LONG_DOUBLE_TYPE_SIZE 64 # define REAL_WIDTH 3 65 # else 66 # if HOST_BITS_PER_WIDE_INT*4 >= MAX_LONG_DOUBLE_TYPE_SIZE 67 # define REAL_WIDTH 4 68 # endif 69 # endif 70 # endif 71 #endif /* REAL_WIDTH */ 72 73 #if REAL_WIDTH == 1 74 # define CONST_DOUBLE_FORMAT "0ww" 75 #else 76 # if REAL_WIDTH == 2 77 # define CONST_DOUBLE_FORMAT "0ww" 78 # else 79 # if REAL_WIDTH == 3 80 # define CONST_DOUBLE_FORMAT "0www" 81 # else 82 # if REAL_WIDTH == 4 83 # define CONST_DOUBLE_FORMAT "0wwww" 84 # else 85 # if REAL_WIDTH == 5 86 # define CONST_DOUBLE_FORMAT "0wwwww" 87 # else 88 # define CONST_DOUBLE_FORMAT /* nothing - will cause syntax error */ 89 # endif 90 # endif 91 # endif 92 # endif 93 #endif 94 95 96 struct rtx_definition 31 struct rtx_definition 97 32 { 98 33 const char *const enumname, *const name, *const format; … … 101 36 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGX(ENUM), NAME, FORMAT }, 102 37 103 static const struct rtx_definition defs[] = 104 { 38 static const struct rtx_definition defs[] = 39 { 105 40 #include "rtl.def" /* rtl expressions are documented here */ 106 41 }; … … 112 47 static int special_format PARAMS ((const char *)); 113 48 static int special_rtx PARAMS ((int)); 49 static int excluded_rtx PARAMS ((int)); 114 50 static void find_formats PARAMS ((void)); 115 51 static void gendecl PARAMS ((const char *)); … … 147 83 case 't': 148 84 return "union tree_node *"; /* tree - typedef not available */ 85 case 'B': 86 return "struct basic_block_def *"; /* basic block - typedef not available */ 149 87 default: 150 88 abort (); … … 181 119 return "XTREE"; 182 120 121 case 'B': 122 return "XBBDEF"; 123 183 124 default: 184 125 abort (); … … 199 140 } 200 141 201 /* Return nonzero if the RTL code given by index IDX is one that we should not202 generate a gen_ RTX_FOO function foo (because that function is present203 elsewhere in the compiler). */142 /* Return nonzero if the RTL code given by index IDX is one that we should 143 generate a gen_rtx_raw_FOO macro for, not gen_rtx_FOO (because gen_rtx_FOO 144 is a wrapper in emit-rtl.c). */ 204 145 205 146 static int … … 208 149 { 209 150 return (strcmp (defs[idx].enumname, "CONST_INT") == 0 210 || strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0211 151 || strcmp (defs[idx].enumname, "REG") == 0 212 152 || strcmp (defs[idx].enumname, "SUBREG") == 0 213 || strcmp (defs[idx].enumname, "MEM") == 0); 153 || strcmp (defs[idx].enumname, "MEM") == 0 154 || strcmp (defs[idx].enumname, "CONST_VECTOR") == 0); 155 } 156 157 /* Return nonzero if the RTL code given by index IDX is one that we should 158 generate no macro for at all (because gen_rtx_FOO is never used or 159 cannot have the obvious interface). */ 160 161 static int 162 excluded_rtx (idx) 163 int idx; 164 { 165 return (strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0); 214 166 } 215 167 … … 245 197 const char *p; 246 198 int i, pos; 247 199 248 200 printf ("extern rtx gen_rtx_fmt_%s\tPARAMS ((RTX_CODE, ", format); 249 201 printf ("enum machine_mode mode"); … … 270 222 write. */ 271 223 272 static void 224 static void 273 225 genmacro (idx) 274 226 int idx; … … 280 232 gen_rtx_fmt_FORMAT where FORMAT is the RTX_FORMAT of RTLCODE. */ 281 233 234 if (excluded_rtx (idx)) 235 /* Don't define a macro for this code. */ 236 return; 237 282 238 printf ("#define gen_rtx_%s%s(MODE", 283 239 special_rtx (idx) ? "raw_" : "", defs[idx].enumname); … … 306 262 const char *p; 307 263 int i, j; 308 264 309 265 /* Start by writing the definition of the function name and the types 310 266 of the arguments. */ … … 383 339 puts ("#include \"ggc.h\"\n"); 384 340 puts ("extern struct obstack *rtl_obstack;\n"); 385 puts ("#define obstack_alloc_rtx(n) \\");386 puts (" ((rtx) obstack_alloc (rtl_obstack, \\");387 puts (" sizeof (struct rtx_def) \\");388 puts (" + ((n) - 1) * sizeof (rtunion)))\n");389 341 390 342 for (fmt = formats; *fmt != 0; fmt++) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.