zahiraam added a comment.

In D109239#3878422 <https://reviews.llvm.org/D109239#3878422>, @ArcsinX wrote:

> It seems for x86_32 case (e.g. with -m32 in command line) there is a 
> difference between clang and GCC:
> clang: `__FLT_EVAL_METHOD__` == 0
> GCC: `__FLT_EVAL_METHOD__` == 2
>
> Example:
> https://godbolt.org/z/EbY8rPYGn
>
> I am not sure, is it a correct behavior from clang?

For 32-bit x86 targets, GCC defaults to -mfpmath=387 (no SSE). Passing 
-mfpmath=sse to GCC will use source precision. 
Clang’s 32-bit x86 targets defaults to using SSE instructions and evaluating at 
source precision. Clang doesn’t allow -mfpmath=387 
unless it’s passed along with -mno-sse which is redundant. Using -m32 (or 
-mfpmath=387) in combination with
-mno-sse will give you GCC’s default behavior. See 
https://godbolt.org/z/4d8fqzqEs


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109239/new/

https://reviews.llvm.org/D109239

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D109239: Add s... Aleksandr Platonov via Phabricator via cfe-commits
    • [PATCH] D109239: ... Zahira Ammarguellat via Phabricator via cfe-commits

Reply via email to