Fix HAVE_F16C and LIBC_VERSION

This commit is contained in:
Francois Kritzinger 2022-02-11 13:38:01 +02:00
parent c251ce6fe7
commit 26aab9ba94
2 changed files with 18 additions and 4 deletions

View File

@ -10,9 +10,18 @@
* https://docs.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list
* https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list)
*
* Instead we make use of the fact that all processors that support AVX2
* also support F16C.
*
* Supported since Intel's Ivy Bridge (2012) and AMD's Bulldozer (2011). Added
* to GCC 4.6.4 (2013) at the latest.
*/
#ifdef __F16C__
#ifdef _MSC_VER
# ifdef __AVX2__
# define HAVE_F16C 1
# endif
#else
# ifdef __F16C__
# define HAVE_F16C 1
# endif
#endif

View File

@ -82,8 +82,13 @@
*/
#if defined(__linux__)
# include <features.h> /* __GLIBC__, __GLIBC_MINOR__, __GLIBC_PREREQ() */
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
# include <sys/param.h> /* __FreeBSD_version, OpenBSD, __NetBSD_Version__ */
#elif defined(__FreeBSD__)
# include <osreldate.h> /* __FreeBSD_version */
#elif defined(__OpenBSD__) || defined(__NetBSD__)
/* Note: sys/param.h defines macros with common names such as ALIGN which may
* clash with user code (see Qt).
*/
# include <sys/param.h> /* OpenBSD, __NetBSD_Version__ */
#elif defined(__APPLE__)
# include <Availability.h> /* __MAC_OS_X_VERSION_MIN_REQUIRED */
#endif