From befe79d10367ef80bcbf6844d65d4798bca24f54 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Fri, 15 Dec 2017 11:39:21 -0800 Subject: [PATCH] Merge changes from thekla-atlas. --- src/nvmath/ftoi.h | 8 +------- src/nvmath/nvmath.h | 16 +++++++--------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/nvmath/ftoi.h b/src/nvmath/ftoi.h index 4258b8a..ffc6889 100755 --- a/src/nvmath/ftoi.h +++ b/src/nvmath/ftoi.h @@ -53,7 +53,7 @@ namespace nv return (val<0) ? ftoi_ceil_xs(val) : ftoi_floor_xs(val); } -#if NV_CPU_X86 || NV_CPU_X86_64 +#if NV_USE_SSE NV_FORCEINLINE int ftoi_round_sse(float f) { return _mm_cvt_ss2si(_mm_set_ss(f)); @@ -63,12 +63,6 @@ namespace nv return _mm_cvtt_ss2si(_mm_set_ss(f)); } -#endif - - - -#if NV_USE_SSE - NV_FORCEINLINE int ftoi_round(float val) { return ftoi_round_sse(val); } diff --git a/src/nvmath/nvmath.h b/src/nvmath/nvmath.h index 7810c9f..6016f28 100644 --- a/src/nvmath/nvmath.h +++ b/src/nvmath/nvmath.h @@ -14,12 +14,6 @@ #include // finite, isnan #endif -#if NV_CPU_X86 || NV_CPU_X86_64 - //#include - #include -#endif - - // Function linkage #if NVMATH_SHARED @@ -42,22 +36,26 @@ #endif #ifndef NV_USE_SSE + // 1=SSE, 2=SSE2 # if NV_CPU_X86_64 // x64 always supports at least SSE2 # define NV_USE_SSE 2 # elif NV_CC_MSVC && defined(_M_IX86_FP) // Also on x86 with the /arch:SSE flag in MSVC. -# define NV_USE_SSE _M_IX86_FP // 1=SSE, 2=SS2 -# elif defined(__SSE__) -# define NV_USE_SSE 1 +# define NV_USE_SSE _M_IX86_FP # elif defined(__SSE2__) # define NV_USE_SSE 2 +# elif defined(__SSE__) +# define NV_USE_SSE 1 # else // Otherwise we assume no SSE. # define NV_USE_SSE 0 # endif #endif +#if NV_USE_SSE + #include +#endif // Internally set NV_USE_SIMD when either altivec or sse is available. #if NV_USE_ALTIVEC && NV_USE_SSE