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

            Bug ID: 121696
           Summary: __VSX__ is defined on Darwin, where it cannot possibly
                    be supported
           Product: gcc
           Version: 14.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vital.had at gmail dot com
                CC: iains at gcc dot gnu.org, pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc*-apple-darwin

Could someone say why we have `__VSX__` defined on powerpc*-apple-darwin? I
keep bumping into breakages since everyone – IMO, quite naturally – assumes
that `#ifdef __VSX__` ensures that the code is only used where VSX insns are
supported. However, it is not the case, apparently.

Example with Eigen: https://gitlab.com/libeigen/eigen/-/merge_requests/1150

An issue I ran into right now, where using `#if !defined(__VSX__)` did not work
as I would expect, and I had to explicitly use `#if !defined(__APPLE__)`:
https://github.com/barracuda156/highwayhash/commit/846fc621842037f13d5d74a5c770f7be9ae038e2

I think there were some other cases. Is this a bug or something by design?

It also doesn’t help that gcc error messages are somewhat misleading,
suggesting compilation with `-mvsx`, which won’t work where insns aren’t
recognized to begin with.

Reply via email to