Fix softfloat3 build with MSVC 32-bit. Apparenly it's all-or-nothing with built-in leading zero count. (nw)

This commit is contained in:
Vas Crabb 2018-05-27 22:08:35 +10:00
parent c372746c61
commit a1ecd03c9d

View File

@ -54,21 +54,28 @@ Softfloat 3 MAME modifications
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
// true for GCC and Clang on Intel and ARM, and MSVC on Intel.
#define SOFTFLOAT_BUILTIN_CLZ 1
#if defined(_MSC_VER)
#ifdef _MSC_VER
#define _INC_MALLOC 0
#include <intrin.h>
// MSVC has __lzcnt16 as well, but opts-GCC.h expects __lzcnt for uint16_t and uint32_t
#if defined(_M_IX86) || defined(_M_AMD64)
#define __builtin_clz __lzcnt
#endif // defined(_M_IX86) || defined(_M_AMD64)
#if defined(_M_AMD64)
#define SOFTFLOAT_BUILTIN_CLZ 1
#define __builtin_clzll __lzcnt64
#else
#endif // defined(_M_AMD64)
#else // defined(_MSC_VER)
// true for GCC and Clang on Intel and ARM, and MSVC on Intel.
#define SOFTFLOAT_BUILTIN_CLZ 1
#if defined(PTR64)
#define SOFTFLOAT_INTRINSIC_INT128 1
#endif
#endif
#endif // defined(PTR64)
#endif // defined(_MSC_VER)
#include "opts-GCC.h"