https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101865

--- Comment #14 from wschmidt at linux dot ibm.com ---
On 8/31/21 11:09 AM, bergner at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101865
>
> --- Comment #13 from Peter Bergner <bergner at gcc dot gnu.org> ---
> (In reply to Tulio Magno Quites Machado Filho from comment #12)
>> There is a chance, that my previous comment is wrong with regards the
>> generation of VSX instructions for Power8.
>>
>> I don't know what the second command means:
>>
>> $ gcc-11 -mcpu=power10 -dM -E - < /dev/null | grep -E 'VECTOR|VSX|ALTIVEC'
>> #define __VSX__ 1
>> #define __ALTIVEC__ 1
>> #define __POWER9_VECTOR__ 1
>> #define __APPLE_ALTIVEC__ 1
>> #define __POWER8_VECTOR__ 1
>> $ gcc-11 -mcpu=power10 -mno-power8-vector -dM -E - < /dev/null | grep -E
>> 'VECTOR|VSX|ALTIVEC'
>> #define __VSX__ 1
>> #define __ALTIVEC__ 1
>> #define __APPLE_ALTIVEC__ 1
> __VSX__ doesn't mean all of VSX is enabled.  IIRC, __VSX__ is the macro you
> would use to see whether you have POWER7 VSX support.  For POWER8's VSX
> support, you'd use __POWER8_VECTOR__, etc.  So in your last compile, you
> disabled vector support from POWER8 onwards, but that leaves vector support
> from POWER7 and earlier, ie, __VSX__ and __ALTIVEC__.  If you had used
> -mno-vsx, you'd still have __ALTIVEC__ and __APPLE_ALTIVEC__ defined.  
> Finally,
> if you have used -mno-altivec, then you would have disabled all vector 
> support.
>
I disagree with that.  You should use __VSX__ && _ARCH_PWR9 to check for 
P9 vector support, etc.  The __POWERn_VECTOR__ things really are not 
great and I wish they had never been added.

Reply via email to