This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] convert v850 to constraints.md
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, nickc at redhat dot com
- Date: Fri, 11 Feb 2011 10:38:56 -0800
- Subject: Re: [PATCH] convert v850 to constraints.md
- References: <20110211181828.GR6247@codesourcery.com> <4D55801F.4020206@redhat.com>
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