This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] asms with more than 10 operands
- To: Bruno Haible <haible at ilog dot fr>
- Subject: Re: [patch] asms with more than 10 operands
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 05 Apr 1998 17:26:35 -0600
- Cc: egcs at cygnus dot com, wilson at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199803301403.QAA18105@halles.ilog.fr>you write:
> Here is an updated version of my patch from 5 March 1998.
>
>
> In a recent projects, I had big problems with some asm code on Sparc which
> used about 12 asm arguments. The hard limit of 10 asm arguments (counting
> in-out registers twice!) is very bad. Geoffrey Keating stumbled upon the
> same limitation on PowerPC. Can you please put this into egcs,
> so that people can use "CFLAGS += -DMAX_RECOG_OPERANDS=20" when they see
> need for it? Thanks.
First, don't send patches to people directly. Send them to the list
you have a better chance of getting them reviewed that way :-)
> Mon Mar 30 02:35:50 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsr
> uhe.de>
>
> * genconfig.c (main): Make MAX_RECOG_OPERANDS customizable.
> * regmove.c (find_matches): Accept multi-digit constraints.
> * reload.c (find_reloads): Likewise.
> * stmt.c (expand_asm_operands): Likewise.
> * sparc.h (MAX_RECOG_OPERANDS): Define.
Won't some of your changes (like those in stmt.c) read %12 as operand
12 and advance the char pointer beyond the '2', regardless of the
value of MAX_RECOG_OPERANDS?
I don't generally like the idea of allowing ports to redefine
MAX_RECOG_OPERANDS.
I'd be willing to increase MAX_RECOG_OPERANDS to 20 unconditionally
if we can make sure that various ports don't expect %[letter]12 to mean
"output operand 1, followed by the character '2').
I'd also be willing to redefine how %[letter][digits] works -- I find
it rather odd and fragile that the compiler assumes that only the first
digit will be the operand number and following digits are to be output
verbatim.Your changes make this situation worse (IMHO) because they
make the grammar more ambigious.
I wouldn't mind defining it to mean all the digits are part of the
operand number, specifying a number larger than MAX_OPERANDS is an
error. To output a numeric literal after an operand would require
either an escape or something similar.
So, I'm happy with the general idea of allowing more than 10 operands;
I'm a little worried about the implementation though...
jeff