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]
Other format: [Raw text]

Re: Extend mode macros


Nathan Sidwell <nathan@codesourcery.com> writes:
> I've been using mode macros to clean up the altivec.md file.  There is
> a shortcoming wrt UNSPEC, and this patch addresses that.
>
> UNSPECs look like
> 	(UNSPEC:mode [...] MAGIC_CONSTANT)
> and altivec has distinct UNSPECS for V4SI, V8HI and V16QI modes, all
> with the same template, but different MAGIC_CONSTANTs.

But why do they need to have different constants?  It looks from your
example altivec.md patch like they're doing the same thing conceptually,
but with different sizes, so why not use a single constant for them all?
recog checks both the mode and the constant so there's not going to be
any ambiguity.

FWIW, mips.md has several examples of this.

Not that I'm objecting to an extension to the reader.  It's just that it
doesn't look like stage3 material to me, and the example from altivec.md
looks like something you can clean up with the existing framework.

Richard


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