This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Simple optimization for MASK_STORE.
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Yuri Rumyantsev <ysrumyan at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Igor Zamyatin <izamyatin at gmail dot com>
- Date: Fri, 24 Jul 2015 11:16:13 +0200
- Subject: Re: [PATCH] Simple optimization for MASK_STORE.
- Authentication-results: sourceware.org; auth=none
- References: <CAEoMCqRmV48Ytdew0azyTQWZcmfFmjX-JaLtYUz8Q3wejL2RnQ at mail dot gmail dot com> <CAFiYyc38QMSXL058QuV0TZMAku=Ur0FXhF9TEm2Lp7C_HHmWLg at mail dot gmail dot com> <CAEoMCqQy045OoQu-v0AgWv=i8FPJffSvw7dQXsAYccB-Tc8nLw at mail dot gmail dot com> <CAFiYyc0V91KWWRLmkyUBbafVnS=6ZJz0ntsF7kt8X_0W0rgS4A at mail dot gmail dot com> <CAEoMCqSc7CAn=Rp5aM47szM_B-xa+CCA6r+FhysbBvYz=pxNrQ at mail dot gmail dot com> <559F5D7B dot 6070208 at redhat dot com> <CAEoMCqT+dBfjWkGdwMiSdV_aVjKCAx9b=-OP+eoOxD8_PddkcQ at mail dot gmail dot com> <55B148AB dot 6010103 at redhat dot com>
On Thu, Jul 23, 2015 at 10:03 PM, Jeff Law <law@redhat.com> wrote:
> On 07/20/2015 09:05 AM, Yuri Rumyantsev wrote:
>>
>> Hi Jeff!
>>
>> Thanks for your details comments.
>>
>> You asked:
>> How are conditionals on vectors usually handled? You should try to
>> mimick that and report, with detail, why that's not working.
>>
>> In current implementation of vectorization pass all comparisons are
>> handled through COND_EXPR, i.e. vect-pattern pass transforms all
>> comparisons producing bool values to conditional expressions like a[i]
>> != 0 --> a[i]!=0? 1: 0 which vectorizers transforms to
>> vect-cond-expr. So we don't have operations with vector operands and
>> scalar (bool) result.
>> To implement such operations I introduced target-hook. Could you
>> propose another solution implementing it?
>
> Is there any rationale given anywhere for the transformation into
> conditional expressions? ie, is there any reason why we can't have a
> GIMPLE_COND where the expression is a vector condition?
No rationale for equality compare which would have the semantic of
having all elements equal or not equal. But you can't define a sensible
ordering (that HW implements) for other compare operators and you
obviously need a single boolean result, not a vector of element comparison
results.
I've already replied that I'm fine allowing ==/!= whole-vector compares.
But one needs to check whether expansion does anything sensible
with them (either expand to integer subreg compares or add optabs
for the compares).
Richard.
> Thanks,
>
> Jeff
>