This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Fix PR70963: Wrong code for V2DF/V2DI vec_cts with zero scale factor
- From: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Tue, 10 May 2016 07:12:42 -0500
- Subject: Re: [PATCH, rs6000] Fix PR70963: Wrong code for V2DF/V2DI vec_cts with zero scale factor
- Authentication-results: sourceware.org; auth=none
- References: <3EB3C432-043C-4EA2-A65C-8743A8BB0AE0 at linux dot vnet dot ibm dot com> <20160510082535 dot GA30345 at gate dot crashing dot org>
> On May 10, 2016, at 3:25 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
>
> Hi Bill,
>
> On Mon, May 09, 2016 at 10:00:31PM -0500, Bill Schmidt wrote:
>> PR70963 reports a problem with vec_cts when used to convert vector double to vector long long.
>> This is due to a register with an undefined value that is generated only when the scale factor is
>> zero. This patch adds logic to provide the correct value when the scale factor is zero.
>>
>> The problem from the PR is in the define_expand for vsx_xvcvdpsxds_scale. The define_expand
>> for vsx_xvcvdpuxds_scale clearly has the same problem, although it is not possible to reach this
>> via a call to vec_cts. The raw builtin __builtin_vsx_xvcvdpuxds_scale can be used, however, and
>> Iâve shown this in the test case.
>>
>> Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions. Is this ok for
>> trunk, and eventual backport to 6 and 5?
>
> Okay. A few thingies...
>
>> 2016-05-09 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
>
> You should mention the PR here, like
>
> PR target/70963
>> * config/rs6000/vsx.md (vsx_xvcvdpsxds_scale): Generate correct
>> code for a zero scale factor.
>> (vsx_xvcvdpuxds_scale): Likewise.
>
> This way an automatic comment is made in bugzilla, too. It's magic!
Yeah, I actually noticed this after I sent it. Fixed in my local copy of the change log...
>
>> +++ gcc/config/rs6000/vsx.md (working copy)
>> @@ -1717,10 +1717,15 @@
>> {
>> rtx op0 = operands[0];
>
> Huge amount of trailing space everywhere here (but not in the tree);
> seems like you need to fix your mail client (or its settings).
Yeah, first post from a new mail client on a new laptop. I need to find a different solution as this one has been a pain.
>
>> rtx op1 = operands[1];
>> - rtx tmp = gen_reg_rtx (V2DFmode);
>> + rtx tmp;
>> int scale = INTVAL(operands[2]);
>
> This is the only line you didn't change, and it has a missing space (before
> the paren open); you might want to fix that while you're at it :-)
Will do! Thanks!
Bill
>
>
> Segher
>