Merge changes from thekla-atlas.

pull/273/head
Ignacio 6 years ago
parent 182a326e1c
commit befe79d103

@ -53,7 +53,7 @@ namespace nv
return (val<0) ? ftoi_ceil_xs(val) : ftoi_floor_xs(val); 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) { NV_FORCEINLINE int ftoi_round_sse(float f) {
return _mm_cvt_ss2si(_mm_set_ss(f)); return _mm_cvt_ss2si(_mm_set_ss(f));
@ -63,12 +63,6 @@ namespace nv
return _mm_cvtt_ss2si(_mm_set_ss(f)); return _mm_cvtt_ss2si(_mm_set_ss(f));
} }
#endif
#if NV_USE_SSE
NV_FORCEINLINE int ftoi_round(float val) { NV_FORCEINLINE int ftoi_round(float val) {
return ftoi_round_sse(val); return ftoi_round_sse(val);
} }

@ -14,12 +14,6 @@
#include <float.h> // finite, isnan #include <float.h> // finite, isnan
#endif #endif
#if NV_CPU_X86 || NV_CPU_X86_64
//#include <intrin.h>
#include <xmmintrin.h>
#endif
// Function linkage // Function linkage
#if NVMATH_SHARED #if NVMATH_SHARED
@ -42,22 +36,26 @@
#endif #endif
#ifndef NV_USE_SSE #ifndef NV_USE_SSE
// 1=SSE, 2=SSE2
# if NV_CPU_X86_64 # if NV_CPU_X86_64
// x64 always supports at least SSE2 // x64 always supports at least SSE2
# define NV_USE_SSE 2 # define NV_USE_SSE 2
# elif NV_CC_MSVC && defined(_M_IX86_FP) # elif NV_CC_MSVC && defined(_M_IX86_FP)
// Also on x86 with the /arch:SSE flag in MSVC. // Also on x86 with the /arch:SSE flag in MSVC.
# define NV_USE_SSE _M_IX86_FP // 1=SSE, 2=SS2 # define NV_USE_SSE _M_IX86_FP
# elif defined(__SSE__)
# define NV_USE_SSE 1
# elif defined(__SSE2__) # elif defined(__SSE2__)
# define NV_USE_SSE 2 # define NV_USE_SSE 2
# elif defined(__SSE__)
# define NV_USE_SSE 1
# else # else
// Otherwise we assume no SSE. // Otherwise we assume no SSE.
# define NV_USE_SSE 0 # define NV_USE_SSE 0
# endif # endif
#endif #endif
#if NV_USE_SSE
#include <xmmintrin.h>
#endif
// Internally set NV_USE_SIMD when either altivec or sse is available. // Internally set NV_USE_SIMD when either altivec or sse is available.
#if NV_USE_ALTIVEC && NV_USE_SSE #if NV_USE_ALTIVEC && NV_USE_SSE

Loading…
Cancel
Save