From a2a8cc44e94f866649f05b8c68b82d36a71f1a5a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 4 Feb 2004 06:12:54 +0000 Subject: [PATCH] emit-rtl.c (gen_rtx): Remove. * emit-rtl.c (gen_rtx): Remove. * genattrtab.c: Don't mention gen_rtx in a comment. * rtl.h: Remove the prototype for gen_rtx. * doc/md.texi: Replace gen_rtx with gen_rtx_REG. From-SVN: r77224 --- gcc/ChangeLog | 7 +++ gcc/doc/md.texi | 2 +- gcc/emit-rtl.c | 128 +++-------------------------------------------- gcc/genattrtab.c | 2 +- gcc/rtl.h | 4 +- 5 files changed, 18 insertions(+), 125 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 52e98f14f2b..7a8ff1f4241 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-02-04 Kazu Hirata + + * emit-rtl.c (gen_rtx): Remove. + * genattrtab.c: Don't mention gen_rtx in a comment. + * rtl.h: Remove the prototype for gen_rtx. + * doc/md.texi: Replace gen_rtx with gen_rtx_REG. + 2004-02-04 Kazu Hirata * config/arc/arc.h, config/fr30/fr30.h diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index e81e350578b..f8bf54ef7b9 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -4595,7 +4595,7 @@ Here is an example, taken from the 68000 machine description: "FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])" @{ rtx xoperands[2]; - xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1); + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); #ifdef MOTOROLA output_asm_insn ("move.l %1,(sp)", xoperands); output_asm_insn ("move.l %1,-(sp)", operands); diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 3deefe8218f..12e54bdfd53 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -22,18 +22,19 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Middle-to-low level generation of rtx code and insns. - This file contains the functions `gen_rtx', `gen_reg_rtx' - and `gen_label_rtx' that are the usual ways of creating rtl - expressions for most purposes. + This file contains the functions `gen_reg_rtx' and `gen_label_rtx' + that are the usual ways of creating rtl expressions for most + purposes. It also has the functions for creating insns and linking them in the doubly-linked chain. The patterns of the insns are created by machine-dependent routines in insn-emit.c, which is generated automatically from - the machine description. These routines use `gen_rtx' to make - the individual rtx's of the pattern; what is machine dependent - is the kind of rtx's they make and what arguments they use. */ + the machine description. These routines use `gen_rtx_fmt_ee' and + others to make the individual rtx's of the pattern; what is machine + dependent is the kind of rtx's they make and what arguments they + use. */ #include "config.h" #include "system.h" @@ -645,119 +646,6 @@ gen_lowpart_SUBREG (enum machine_mode mode, rtx reg) subreg_lowpart_offset (mode, inmode)); } -/* rtx gen_rtx (code, mode, [element1, ..., elementn]) -** -** This routine generates an RTX of the size specified by -** , which is an RTX code. The RTX structure is initialized -** from the arguments through , which are -** interpreted according to the specific RTX type's format. The -** special machine mode associated with the rtx (if any) is specified -** in . -** -** gen_rtx can be invoked in a way which resembles the lisp-like -** rtx it will generate. For example, the following rtx structure: -** -** (plus:QI (mem:QI (reg:SI 1)) -** (mem:QI (plusw:SI (reg:SI 2) (reg:SI 3)))) -** -** ...would be generated by the following C code: -** -** gen_rtx_PLUS (QImode, -** gen_rtx_MEM (QImode, -** gen_rtx_REG (SImode, 1)), -** gen_rtx_MEM (QImode, -** gen_rtx_PLUS (SImode, -** gen_rtx_REG (SImode, 2), -** gen_rtx_REG (SImode, 3)))), -*/ - -/*VARARGS2*/ -rtx -gen_rtx (enum rtx_code code, enum machine_mode mode, ...) -{ - int i; /* Array indices... */ - const char *fmt; /* Current rtx's format... */ - rtx rt_val; /* RTX to return to caller... */ - va_list p; - - va_start (p, mode); - - switch (code) - { - case CONST_INT: - rt_val = gen_rtx_CONST_INT (mode, va_arg (p, HOST_WIDE_INT)); - break; - - case CONST_DOUBLE: - { - HOST_WIDE_INT arg0 = va_arg (p, HOST_WIDE_INT); - HOST_WIDE_INT arg1 = va_arg (p, HOST_WIDE_INT); - - rt_val = immed_double_const (arg0, arg1, mode); - } - break; - - case REG: - rt_val = gen_rtx_REG (mode, va_arg (p, int)); - break; - - case MEM: - rt_val = gen_rtx_MEM (mode, va_arg (p, rtx)); - break; - - default: - rt_val = rtx_alloc (code); /* Allocate the storage space. */ - rt_val->mode = mode; /* Store the machine mode... */ - - fmt = GET_RTX_FORMAT (code); /* Find the right format... */ - for (i = 0; i < GET_RTX_LENGTH (code); i++) - { - switch (*fmt++) - { - case '0': /* Field with unknown use. Zero it. */ - X0EXP (rt_val, i) = NULL_RTX; - break; - - case 'i': /* An integer? */ - XINT (rt_val, i) = va_arg (p, int); - break; - - case 'w': /* A wide integer? */ - XWINT (rt_val, i) = va_arg (p, HOST_WIDE_INT); - break; - - case 's': /* A string? */ - XSTR (rt_val, i) = va_arg (p, char *); - break; - - case 'e': /* An expression? */ - case 'u': /* An insn? Same except when printing. */ - XEXP (rt_val, i) = va_arg (p, rtx); - break; - - case 'E': /* An RTX vector? */ - XVEC (rt_val, i) = va_arg (p, rtvec); - break; - - case 'b': /* A bitmap? */ - XBITMAP (rt_val, i) = va_arg (p, bitmap); - break; - - case 't': /* A tree? */ - XTREE (rt_val, i) = va_arg (p, tree); - break; - - default: - abort (); - } - } - break; - } - - va_end (p); - return rt_val; -} - /* gen_rtvec (n, [rt1, ..., rtn]) ** ** This routine creates an rtvec and stores within it the @@ -5389,7 +5277,7 @@ init_emit_once (int line_numbers) /* Create the unique rtx's for certain rtx codes and operand values. */ - /* Don't use gen_rtx here since gen_rtx in this case + /* Don't use gen_rtx_CONST_INT here since gen_rtx_CONST_INT in this case tries to use these variables. */ for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++) const_int_rtx[i + MAX_SAVED_CONST_INT] = diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 56c62e38678..e1a3e728826 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -549,7 +549,7 @@ attr_hash_add_string (int hashcode, char *str) In some cases we cannot uniquify; then we return an ordinary impermanent rtx with ATTR_PERMANENT_P clear. - Args are like gen_rtx, but without the mode: + Args are as follows: rtx attr_rtx (code, [element1, ..., elementn]) */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 8cb4e1b2836..13fd72ba26f 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1445,7 +1445,6 @@ extern rtx plus_constant_for_output_wide (rtx, HOST_WIDE_INT); extern void optimize_save_area_alloca (rtx); /* In emit-rtl.c */ -extern rtx gen_rtx (enum rtx_code, enum machine_mode, ...); extern rtvec gen_rtvec (int, ...); extern rtx copy_insn_1 (rtx); extern rtx copy_insn (rtx); @@ -1874,8 +1873,7 @@ extern GTY(()) rtx return_address_pointer_rtx; /* There are some RTL codes that require special attention; the generation functions included above do the raw handling. If you - add to this list, modify special_rtx in gengenrtl.c as well. You - should also modify gen_rtx to use the special function. */ + add to this list, modify special_rtx in gengenrtl.c as well. */ extern rtx gen_rtx_CONST_INT (enum machine_mode, HOST_WIDE_INT); extern rtx gen_rtx_CONST_VECTOR (enum machine_mode, rtvec); -- 2.30.2