smmintrin.h uses __builtin_mffs, __builtin_mffsl, __builtin_mtfsf and __builtin_set_fpscr_rn. This patch replaces the uses with ppc prefix and implement the missing ones.
This fixes issue 64664.
Paths
| Differential D158066
[PowerPC] Fix use of FPSCR builtins in smmintrin.h AbandonedPublic Authored by qiucf on Aug 16 2023, 3:08 AM.
Details
Diff Detail
Event TimelineComment Actions Are there any plans to align the names of these built-ins with GCC? Their built-ins do not have the _ppc part. Comment Actions
It should be perfectly fine to provide pre-defined macros for these to match GCC on PowerPC. The reason we went with the macro solution is to avoid polluting the builtins namespace for other targets. Also, please add some C++ tests for these PPC wrappers so that we aren't surprised again when someone tries to use these in their C++ code. Comment Actions
It seems these macros do not always work for all PowerPC targets: // -target=ppc64le -mcpu=power9 do not work // -target=ppc64le-unknown-linux-gnu -mcpu=power9 work long calldarn(void) { return __darn(); } Comment Actions
Revision Contents
Diff 555805 clang/include/clang/Basic/BuiltinsPPC.def
clang/lib/Basic/Targets/PPC.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Headers/ppc_wrappers/smmintrin.h
clang/test/CodeGen/PowerPC/builtins-ppc.c
clang/test/CodeGen/PowerPC/ppc-emmintrin.c
clang/test/CodeGen/PowerPC/ppc-mmintrin.c
clang/test/CodeGen/PowerPC/ppc-pmmintrin.c
clang/test/CodeGen/PowerPC/ppc-smmintrin.c
clang/test/CodeGen/PowerPC/ppc-tmmintrin.c
clang/test/CodeGen/PowerPC/ppc-x86gprintrin.c
|