This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: define_insn_and_split patch


On Wed, Apr 26, 2000 at 01:51:00PM -0500, Clinton Popetz wrote:
> --- genattrtab.c	2000/04/26 18:42:51
> *************** gen_insn (exp)
> *** 4305,4308 ****
> --- 4305,4309 ----
>       {
>       case DEFINE_INSN:
> +     case DEFINE_INSN_AND_SPLIT:
>         id->insn_code = insn_code_number++;
>         id->insn_index = insn_index_number++;


> --- gencodes.c	2000/04/26 18:42:51
> *************** from the machine description file `md'. 
> *** 125,128 ****
> --- 125,133 ----
>   	  insn_code_number++;
>   	}
> +       if (GET_CODE (desc) == DEFINE_INSN_AND_SPLIT)
> + 	{
> + 	  gen_insn (desc);
> + 	  insn_code_number += 2;

Seems you're not keeping insn_code_number in sync between the 
various gen programs.  That's fatal.

Rather than just adjusting each of the N programs to match, what say we
create a new gensupport.c that contains the rtx reader function (and
other assundry bits that are not currently shared either).  The job of
this reader function would be to return toplevel rtx together with the
appropriate sequence number, e.g.

	void init_md_reader(const char *filename)
	rtx read_md_rtx(int *seqnr, *lineno)

This would also have the advantage that you wouldn't have to support
DEFINE_INSN_AND_SPLIT in the rest of the gen programs at all -- have
the reader function split it into its component parts.

It would also be helpful when I get ready to work on automatic
cond_exec insn pattern generation, where I'll have to create _lots_
of synthetic define_insn patterns.



r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]