[patch] Fixing ppc64 test failure after patch dealing with scratches in IRA
Vladimir Makarov
vmakarov@redhat.com
Sun Nov 1 23:32:02 GMT 2020
On 2020-10-30 7:36 p.m., Segher Boessenkool wrote:
> Thanks for the patch! But it has a problem:
>
>> diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
>> index 67e4f2fd037..78de85ccbbb 100644
>> --- a/gcc/config/rs6000/vsx.md
>> +++ b/gcc/config/rs6000/vsx.md
>> @@ -3717,7 +3717,7 @@
>> (vec_select:<VS_scalar>
>> (match_operand:VSX_EXTRACT_I 1 "gpc_reg_operand" "<VSX_EX>,v")
>> (parallel [(match_operand:QI 2 "const_int_operand" "n,n")])))
>> - (clobber (match_scratch:<VS_scalar> 3 "=<VSX_EX>,&r"))
>> + (clobber (match_scratch:<VS_scalar> 3 "=*<VSX_EX>,&*r"))
>> (clobber (match_scratch:SI 4 "=X,&r"))]
>> "VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_VEXTRACTUB"
>> "#"
> You add * to both alternatives here? I would expect adding it to only
> the second alternative, does it work better with both?
No. It works the same. When the both alternatives use the hint, the
scratch pseudo got the class ALL_REGS. When only the 2nd use the hint,
the class is VSX_REGS. As I understand now the preferable alternative
is the 1st one (with <VSX> for the scratch). In this case using the
hint only for the 2nd alternative has more sense.
> That also avoids a different problem: *<VSX_EX> won't work as expected.
> '*' in IRA skips one constraint character, but <VSX_EX> can be "wa", a
> two-letter constraint (and we do have an "a" constraint as well,
> something wholly different: "wa" means a VSX register, while "a" is an
> indexed address).
>
> case '*':
> /* Ignore the next letter for this pass. */
> c = *++p;
> break;
>
>
I see. Thanks for pointing this out. Definitely it is better to use the
hint only for the second alternative ("&*r") then. Is this solution ok
for you?
More information about the Gcc-patches
mailing list