This is the mail archive of the gcc@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: RFD: constraint letter suffixes


Ulrich Weigand wrote:
> 
> Joern Rennecke wrote:
> 
> > P.S.: While I am at rewriting all that code, I think I might as well
> > replace uses of REG_CLASS_FROM_LETTER (*str) with
> > REG_CLASS_FROM_CONSTRAINT (*str, str) ;
> 
> As a side note, I was wondering why the new-style macros all get
> both a letter and string (where the letter presumably is always
> guaranteed to be equal to the first character of the string?).

Yes.
	
> What's the reason for this redundancy?

If the macro definition needs only or mostly the first letter, the code
can be somewhat simpler, thus making the compiler faster.  I haven't
benchmarked the impact, but then this might be hard to do in a meanigful
way, as it could vary considerably between targets and input source.
Keeping the interface essentially the same for targets that don't need
the extra functionality seemed to be the safest option.

It also makes it easy to use only the new macros without needing to
dereference if all you want is the first letter.
	
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658


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