> -----Original Message-----
> From: Richard Sandiford [mailto:rdsandif...@googlemail.com]
> Sent: Monday, March 04, 2013 3:54 PM
> To: Moore, Catherine
> Cc: gcc-patches@gcc.gnu.org; Rozycki, Maciej
> Subject: Re: FW: [PATCH] [MIPS] microMIPS gcc support
> 
> "Moore, Catherine" <catherine_mo...@mentor.com> writes:
> > Hi Richard,
> - Predicates should always check the code though.  E.g.:
> 
>   (define_predicate "umips_addius5_imm"
>     (and (match_code "const_int")
>          (match_test "IN_RANGE (INTVAL (op), -8, 7)")))
> 
> - In general, please try to make the names of the predicates as generic
>   as possible.  There's nothing really add-specific about the predicate
>   above.  Or microMIPS-specific either really: some of these predicates
>   are probably going to be useful for MIPS16 too.
> 
>   The existing MIPS16 functions follow the convention:
> 
>       "n" if negated (optional)
>     + "s" or "u" for signed vs. unsigned
>     + "imm"
>     + number of significant bits
>     + "_"
>     + multiplication factor or, er, "b" for "+1"...
> 
>   It might be nice to have a similar convention for microMIPS.
>   The choices there are a bit more exotic, so please feel free to
>   diverge from the MIPS16 one above; we can switch MIPS16 over once
>   the microMIPS one is settled.  In fact, a new convention that's
>   compact enough to be used in both predicate and constraint names
>   would be great.  E.g. for the umips_addius5_imm predicate above,
>   a name like "Ys5" would be easier to remember than "Zo"/"Yo".

How compact would you consider "compact enough"?  I would need to change the 
existing "Y" constraints as well.
Would YG --> Yvec0 be too long?
I think trying to invent some convention with less than four letter will be 
difficult and even with four, I doubt it could be uniformly followed.
I think we could get descriptive with four, however.
Let me know what you think.

> 
>   That said,I realise things like umips_addiur2_imm_p are a bit
>   hard to describe this way and might need to stay instruction-specific.
> 
> - We already have a "ks" constraint for the stack pointer.
> 
> - I like the choice of "u" for M16_REGS.  Kind of lucky that that letter's
>   still free. :-) As you've probably noticed though, we're running desparately
>   short of contraint letters, so if you also need names for other less
>   frequently-used classes, it might be better to use "k..."  for those.
> 
> Thanks,
> Richard

Reply via email to