Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (21 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28dir.info
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/gcc

    • Property svn:ignore
      •  

        old new  
        1 genrtl
        2 genrtl.h
        3 genrtl.c
        41c-parse.y
        52c-parse.h
        63c-parse.c
        74tradcif.c
        8 gcc.info*
        9 cpp.info*
        10 c-tree.info*
        11 cppinternals.info*
        125cscope.files
        136cscope.out
         7cscope.in.out
         8cscope.po.out
         9gengtype-lex.c
         10gengtype-yacc.c
         11gengtype-yacc.h
  • branches/GNU/src/gcc/gcc/gengenrtl.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    11/* 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.
    33
    44This file is part of GCC.
     
    2929#include "real.h"
    3030
    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
     31struct rtx_definition
    9732{
    9833  const char *const enumname, *const name, *const format;
     
    10136#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGX(ENUM), NAME, FORMAT },
    10237
    103 static const struct rtx_definition defs[] = 
    104 { 
     38static const struct rtx_definition defs[] =
     39{
    10540#include "rtl.def"              /* rtl expressions are documented here */
    10641};
     
    11247static int special_format               PARAMS ((const char *));
    11348static int special_rtx                  PARAMS ((int));
     49static int excluded_rtx                 PARAMS ((int));
    11450static void find_formats                PARAMS ((void));
    11551static void gendecl                     PARAMS ((const char *));
     
    14783    case 't':
    14884      return "union tree_node *";  /* tree - typedef not available */
     85    case 'B':
     86      return "struct basic_block_def *";  /* basic block - typedef not available */
    14987    default:
    15088      abort ();
     
    181119      return "XTREE";
    182120
     121    case 'B':
     122      return "XBBDEF";
     123
    183124    default:
    184125      abort ();
     
    199140}
    200141
    201 /* Return nonzero if the RTL code given by index IDX is one that we should not
    202    generate a gen_RTX_FOO function foo (because that function is present
    203    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).  */
    204145
    205146static int
     
    208149{
    209150  return (strcmp (defs[idx].enumname, "CONST_INT") == 0
    210           || strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0
    211151          || strcmp (defs[idx].enumname, "REG") == 0
    212152          || 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
     161static int
     162excluded_rtx (idx)
     163     int idx;
     164{
     165  return (strcmp (defs[idx].enumname, "CONST_DOUBLE") == 0);
    214166}
    215167
     
    245197  const char *p;
    246198  int i, pos;
    247  
     199
    248200  printf ("extern rtx gen_rtx_fmt_%s\tPARAMS ((RTX_CODE, ", format);
    249201  printf ("enum machine_mode mode");
     
    270222   write.  */
    271223
    272 static void 
     224static void
    273225genmacro (idx)
    274226     int idx;
     
    280232     gen_rtx_fmt_FORMAT where FORMAT is the RTX_FORMAT of RTLCODE.  */
    281233
     234  if (excluded_rtx (idx))
     235    /* Don't define a macro for this code.  */
     236    return;
     237
    282238  printf ("#define gen_rtx_%s%s(MODE",
    283239           special_rtx (idx) ? "raw_" : "", defs[idx].enumname);
     
    306262  const char *p;
    307263  int i, j;
    308  
     264
    309265  /* Start by writing the definition of the function name and the types
    310266     of the arguments.  */
     
    383339  puts ("#include \"ggc.h\"\n");
    384340  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");
    389341
    390342  for (fmt = formats; *fmt != 0; fmt++)
Note: See TracChangeset for help on using the changeset viewer.