util: Now DETECT_ARCH_X86_64 can be safely used in rounding.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36744>
This commit is contained in:
Yonggang Luo
2025-08-13 02:17:01 +08:00
committed by Marge Bot
parent 219905aec7
commit fcab92d557
+5 -3
View File
@@ -28,7 +28,9 @@
#include <stdint.h>
#include <math.h>
#if defined(__SSE__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1)) || (defined(_M_X64) && !defined(_M_ARM64EC))
#include "util/detect_arch.h"
#if defined(__SSE__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1)) || DETECT_ARCH_X86_64
#include <xmmintrin.h>
#include <emmintrin.h>
#endif
@@ -94,7 +96,7 @@ _mesa_roundeven(double x)
static inline long
_mesa_lroundevenf(float x)
{
#if defined(__SSE__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1)) || (defined(_M_X64) && !defined(_M_ARM64EC))
#if defined(__SSE__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1)) || DETECT_ARCH_X86_64
#if LONG_MAX == INT64_MAX
return _mm_cvtss_si64(_mm_load_ss(&x));
#elif LONG_MAX == INT32_MAX
@@ -114,7 +116,7 @@ _mesa_lroundevenf(float x)
static inline long
_mesa_lroundeven(double x)
{
#if defined(__SSE2__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || (defined(_M_X64) && !defined(_M_ARM64EC))
#if defined(__SSE2__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || DETECT_ARCH_X86_64
#if LONG_MAX == INT64_MAX
return _mm_cvtsd_si64(_mm_load_sd(&x));
#elif LONG_MAX == INT32_MAX