[clang] [PowerPC] Fix use of FPSCR builtins in smmintrin.h (PR #67299)

Stefan Pintilie via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 20 07:15:31 PDT 2023


stefanp-ibm wrote:

> I personally prefer this solution. @stefanp-ibm What do you think?
> 
> LGTM

I understand your point about forcing users to just use `mffs` when `mffsl` is not available. If that's the case do we also want to change this:
```
#ifdef _ARCH_PWR9
    __fpscr_save.__fr = __builtin_ppc_mffsl();
#else
    __fpscr_save.__fr = __builtin_ppc_mffs();
    __fpscr_save.__fpscr &= 0x70007f0ffL;
#endif
```
and just use:
```
#ifdef _ARCH_PWR9
    __fpscr_save.__fr = __builtin_ppc_mffsl();
#else
   // Since mffsl is not available on anything before Power 9 use the longer latency instruction.
    __fpscr_save.__fr = __builtin_ppc_mffs();
#endif
```


https://github.com/llvm/llvm-project/pull/67299


More information about the cfe-commits mailing list