This is the mail archive of the 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: [PATCH 8/8] Add a common .md file and define standard constraints there

On 06/05/14 15:43, Richard Sandiford wrote:
This final patch uses a common .md file to define all standard
constraints except 'g'.  It then gets rid of explicit case statements
for the standard constraints, except in two cases:

(1) recog.c:asm_operand_ok still needs to handle 'o' specially for
     targets like ia64 that don't have offsettable addresses.  See the
     comment there for justification.

(2) the trickier cases in reload.  I'm not changing those more than I have to.
Can't argue with #2 ;-) reload gets less and less important every day, so I see less and less value hacking too much on it.

I did wonder about defining a new rtl construct that could be used for 'g',
so that even that special case goes away.  In the end I think it would be
a false abstraction though.  No other constraint allows (or IMO should allow)
all three of a register class, a base-reloadable memory and a constant,
so handling it in the lookup_constraint paths would make things more
complicated rather than less.

Note that the s390 'e' constraint is TARGET_MEM_CONSTRAINT, which is now
defined in the common file.

I put the common .md file in the main gcc/ directory by analogy with
defaults.h and common.opt.  It could instead go in config/ or config/common/,
if those sound better.
Seems fine to me, I don't feel a need to bikeshed here.

Does the comment before indep_constraints in genoutput need updating? The constraints in are machine independent, but aren't listed in indep_constraints in genoutput.c

Approved with whatever language you want to use for that comment.


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