[PATCH] D30415: Fix -mno-altivec cannot overwrite -maltivec option

Ulrich Weigand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 21 10:19:32 PDT 2017


uweigand added a comment.

In https://reviews.llvm.org/D30415#705889, @echristo wrote:

> In https://reviews.llvm.org/D30415#705196, @uweigand wrote:
>
> > Well, mainline GCC doesn't have -faltivec at all and never had, I think this was only an Apple GCC extension ...  Not sure what exactly the semantics of that was.
>
>
> Sure it does and has for years. Check out rs6000/darwin.h :)
>
> FWIW: It turns on maltivec and adds a -include of altivec.h


Huh, I wasn't aware of that feature on Darwin, thanks for pointing it out ...

> Nearly all of the code in lib/Driver/ToolChains/Clang.cpp and lib/Driver/ToolChains/Arch/PPC.cpp that deal with altivec. Simplifying the interface by getting rid of needing to check multiple options.

But why would that code no longer be necessary for -maltivec?  Well, I guess I'll wait for your patch ...

If we indeed get rid of -faltivec, I'm wondering whether it would also make sense to get rid of -fzvector.  This is just an alias for -mzvector, and it isn't supported by GCC either.  I added it only because Richard Smith specifically asked for it when I contributed the feature here:
https://reviews.llvm.org/D11001

> This should be a -f flag, not a -m flag. (I think we only support -maltivec for GCC compatibility.)




https://reviews.llvm.org/D30415





More information about the cfe-commits mailing list