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.

Reply via email to