lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Better support for non-x87 platforms


From: Vadim Zeitlin
Subject: Re: [lmi] [PATCH] Better support for non-x87 platforms
Date: Fri, 6 Jan 2017 19:16:44 +0100

On Thu, 5 Jan 2017 23:09:56 +0000 Greg Chicares <address@hidden> wrote:

GC> Okay, then the lack of ideality is immanent in clang, and there's
GC> nothing we can do about that. Let me ask, just to be sure--does
GC> the x87 test work with clang?

 Yes, I can confirm that it does and the current code compiles with almost
no problems with clang (the only warning concerns unnecessarily using
"-pthread" when linking and is a bug in configure which I'll fix) and all
the math-related tests pass.

GC> In relevant part:
GC> 
GC> #if defined LMI_X86
GC> #   if defined __GNUC__
GC> #       if !defined __SSE_MATH__
GC> #           define LMI_X87
GC> #       endif // !defined __SSE_MATH__
GC> #   elif defined _MSC_VER
GC> 
GC> Now, clang defines __GNUC__, and it can't handle x87, so we rely
GC> on it not defining __SSE_MATH__.

 No, sorry, we rely on it _defining_ __SSE_MATH__, which it does because it
uses SSE instructions.

GC> Would it be more robust to test for clang explicitly?

 I don't think so, if somebody really wants to use x87 math in clang with
lmi and manages to make it work, why should we preventively stop him?

GC>  #if defined LMI_X86
GC> +#   if defined __clang__
GC> +       // Do nothing: clang doesn't support x87.
GC> +#   elif defined __GNUC__
GC> -#   if defined __GNUC__
GC>  #       if !defined __SSE_MATH__
GC>  #           define LMI_X87
GC>  #       endif // !defined __SSE_MATH__

 This would result in compiling but not correctly working code in the above
case, so IMHO it would be a bad idea. The current check is just fine
AFAICS.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]