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

Stefan Pintilie via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 06:59:26 PDT 2023


================
@@ -68,10 +68,10 @@ extern __inline __m128d
     __asm__("mffsce %0" : "=f"(__fpscr_save.__fr));
     __enables_save.__fpscr = __fpscr_save.__fpscr & 0xf8;
 #else
-    __fpscr_save.__fr = __builtin_mffs();
+    __fpscr_save.__fr = __builtin_ppc_mffs();
----------------
stefanp-ibm wrote:

I'm not sure that there are any assumptions broken here. For example, `__builtin_ppc_set_fpscr_rn` only uses the last two bits for the rounding control and masks off the rest anyway. Also, `__builtin_ppc_mtfsf(0b00000011, __fpscr_save.__fr);` is using the mask `0b00000011` so it only uses the last 8 bits. 

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


More information about the cfe-commits mailing list