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: [PATCH] convert v850 to constraints.md


On Fri, Feb 11, 2011 at 10:29:51AM -0800, Richard Henderson wrote:
> On 02/11/2011 10:18 AM, Nathan Froyd wrote:
> > +(define_constraint "L"
> > +  "A valid constant for a movhi instruction."
> > +  (and (match_code "const_int")
> > +       (ior (match_test "(ival | 0x7fff0000) == 0x7fff0000")
> > +	    (match_test "(ival | 0x7fff0000) + 0x10000 == 0"))))
> 
> Not a valid translation from the original.  This doesn't work
> for 64-bit HWI.  C.f. the alpha L constraint, which is looking
> for the exact same range of values.

Hm, I was lazy and copied from LUI_OPERAND in mips.h.  I'll take a look
at Alpha's.

> > -    return CONST_DOUBLE_OK_FOR_G (op);
> > +    return constraint_satisfied_p (op, CONSTRAINT_G);
> 
> You can use satisfies_constraint_G directly.  And elsewhere.

I tried that, but met with a number of link errors because several files
do not include tm-constrs.h.  grepping for tm-constrs.h suggested that
it was only used in backend files, so I thought constraint_satisfied_p
would be better.  I'm happy to uses satisfies_constraint_foo if
twiddling target-independent files is OK.

-Nathan


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