This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: how can I write a right V32QI Unpack Low Data insn pattern?
- From: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- To: Liu <proljc at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc at gcc dot gnu dot org, hellogcc <hellogcc at freelists dot org>
- Date: Wed, 02 Mar 2011 14:06:32 +0000
- Subject: Re: how can I write a right V32QI Unpack Low Data insn pattern?
- References: <AANLkTin2H0y4LRr6=z+=1+NZuRa1hFBuF6wXg2HivEHt@mail.gmail.com> <mcr1v2rg2lx.fsf@google.com> <AANLkTinBUxKw+PdMbuw9zUSuPHw3QhqpjOWQotu46zun@mail.gmail.com>
On 02/03/2011 07:56, Liu wrote:
> The wrong code is :
> L9284: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, {);
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (13)])
> goto L9285;
> goto ret0;
>
> L9285: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, |);
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (45)])
> goto L9286;
> goto ret0;
>
> L9286: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, });
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (14)])
> goto L9287;
> goto ret0;
>
> L9287: ATTRIBUTE_UNUSED_LABEL
> x3 = XEXP (x2, ~);
> if (x3 == const_int_rtx[MAX_SAVED_CONST_INT + (46)])
> goto L9288;
> goto ret0;
Well, that's coming from here:
else
printf ("%sx%d = XEXP (x%d, %c);\n",
indent, depth + 1, depth, newpos[depth]);
++depth;
at the end of genrecog.c#change_state(). The problematic position string is
presumably being generated here:
if (was_code == MATCH_OPERATOR || was_code == MATCH_PARALLEL)
{
char base = (was_code == MATCH_OPERATOR ? '0' : 'a');
for (i = 0; i < (size_t) XVECLEN (pattern, 2); i++)
{
subpos[depth] = i + base;
sub = add_to_sequence (XVECEXP (pattern, 2, i),
&sub->success, subpos, insn_type, 0);
}
}
in the MATCH_OPERAND case of the big switch in add_to_sequence(). Possibly
change_state needs to do something like
printf ("%sx%d = XEXP (x%d, %d);\n",
indent, depth + 1, depth,
newpos[depth] > 'a'
? newpos[depth] - 'a'
: newpos[depth] - '0');
... but you need someone who understands genrecog and how the position string
representations are supposed to work to advise you here, and that's not me I'm
afraid.
cheers,
DaveK