lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ae3dc97 3/7: Test for x87


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ae3dc97 3/7: Test for x87
Date: Thu, 5 Jan 2017 03:41:39 +0000 (UTC)

branch: master
commit ae3dc97478748670f1b770929830776dd60771ae
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Test for x87
---
 config.hpp |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/config.hpp b/config.hpp
index 72c9164..7f0557b 100644
--- a/config.hpp
+++ b/config.hpp
@@ -148,6 +148,22 @@ namespace fs = boost::filesystem;
 #   define LMI_MSVCRT
 #endif // Compilers that use the msvc C runtime, without corrections such as 
libmingwex.
 
+// Test for x87.
+//
+// For gcc, test the __SSE_MATH__ macro. It might seem logical to test
+// the __SSE__ macro instead; however, for x86_64, gcc defines __SSE__
+// even if SSE is explicitly disabled with '-mfpmath=387'.
+
+#if defined LMI_X86
+#   if defined __GNUC__ && !defined __SSE_MATH__
+#       define LMI_X87
+#   elif defined LMI_MSC && defined _M_IX86_FP && _M_IX86_FP == 0
+#       define LMI_X87
+#   else   // Unknown compiler.
+#       error Unknown compiler--cannot detect SSE. Consider contributing 
support.
+#   endif  // Unknown compiler.
+#endif // defined LMI_X86
+
 #if defined HAVE_CONFIG_H // Using autoconf.
 #   include "config.h"
 #else // Not using autoconf.



reply via email to

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