On Fri, Jan 28, 2022 at 11:50:20AM -0600, Bill Schmidt wrote: > It was recently pointed out that we get anomalous behavior when using > __attribute__((target)) to select a CPU. As an example, when building for > -mcpu=power8 but using __attribute__((target("mcpu=power10")), it is legal > to call __builtin_vec_mod, but not vec_mod, even though these are > equivalent. This is because the equivalence is established with a #define > that is guarded by #ifdef _ARCH_PWR10.
Yeah that is bad. > This goofy behavior occurs with both the old builtins support and the > new. One of the goals of the new builtins support was to make sure all > appropriate interfaces are available using __attribute__((target)), so I > failed in this respect. This patch corrects the problem by removing the > apply. For example, #ifdef __PPU__ is still appropriate. "By removing the apply"... What does that mean? Nice cleanup (and nice bugfix of course). Okay for trunk (with that comment improved a bit perhaps). Thanks! Segher