[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [PATCH] Better support for non-x87 platforms
From: |
Greg Chicares |
Subject: |
Re: [lmi] [PATCH] Better support for non-x87 platforms |
Date: |
Thu, 5 Jan 2017 23:09:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 |
On 2017-01-05 16:34, Vadim Zeitlin wrote:
> On Thu, 5 Jan 2017 15:17:37 +0000 Greg Chicares <address@hidden> wrote:
[...]
> GC> http://stackoverflow.com/questions/22581350/clang-5-1-fpmath
> GC> | for Clang to accept -mfpmath=387, I had to also pass -mno-sse
[...but you tried, and got...]
> fatal error: error in backend: SSE register return with SSE disabled
> clang: error: clang frontend command failed with exit code 70 (use -v to see
> invocation)
>
> I found several bug reports about this error message, but they also seem to
> be already fixed in the (very recent) version I'm using or not relevant, so
> I'm not sure what's going on here. I'm even less sure whether it makes
> sense to spend any more time on this though, I don't see any good reason to
> use x87 instructions with clang, do you?
Thanks for trying. I don't think it's worth any further effort for clang.
> GC> I'm not necessarily adamant about (1), but it doesn't seem ideal
> GC> to let clang (e.g.) default silently to SSE.
>
> There are two objections to this: first, clang definitely does default to
> SSE (and my experience seems to indicate that it's not that simple to avoid
> using SSE with it) and, second, clang predefines __GNUC__ anyhow, so it's
> already covered by gcc checks.
Okay, then the lack of ideality is immanent in clang, and there's
nothing we can do about that. Let me ask, just to be sure--does
the x87 test work with clang? In relevant part:
#if defined LMI_X86
# if defined __GNUC__
# if !defined __SSE_MATH__
# define LMI_X87
# endif // !defined __SSE_MATH__
# elif defined _MSC_VER
Now, clang defines __GNUC__, and it can't handle x87, so we rely
on it not defining __SSE_MATH__. Would it be more robust to test
for clang explicitly? E.g.:
#if defined LMI_X86
+# if defined __clang__
+ // Do nothing: clang doesn't support x87.
+# elif defined __GNUC__
-# if defined __GNUC__
# if !defined __SSE_MATH__
# define LMI_X87
# endif // !defined __SSE_MATH__
> GC> I just pushed a change that looks very much like your rewrite
> GC> above, and moves the LMI_X86 and LMI_X87 tests into propinquity.
>
> Thanks! This does (mostly) compiles now but still stops further on with
>
> fenv_lmi.cpp:94:41: error: unused parameter 'precision_mode'
> [-Werror=unused-parameter]
>
> The following trivial patch allows the compilation to succeed
Applied and pushed. Thanks.
- [lmi] [PATCH] Better support for non-x87 platforms, Vadim Zeitlin, 2017/01/03
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Greg Chicares, 2017/01/04
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Vadim Zeitlin, 2017/01/04
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Greg Chicares, 2017/01/04
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Greg Chicares, 2017/01/04
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Vadim Zeitlin, 2017/01/05
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Greg Chicares, 2017/01/05
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Vadim Zeitlin, 2017/01/05
- Re: [lmi] [PATCH] Better support for non-x87 platforms,
Greg Chicares <=
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Vadim Zeitlin, 2017/01/06
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Greg Chicares, 2017/01/04
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Vadim Zeitlin, 2017/01/05
- Re: [lmi] [PATCH] Better support for non-x87 platforms, Greg Chicares, 2017/01/05
[lmi] feholdexcept() [Was: Better support for non-x87 platforms], Greg Chicares, 2017/01/05