Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/libraries/source/nvtt/src/src/nvmath/nvmath.h
// This code is in the public domain -- castanyo@yahoo.es | // This code is in the public domain -- castanyo@yahoo.es | ||||
#pragma once | #pragma once | ||||
#ifndef NV_MATH_H | #ifndef NV_MATH_H | ||||
#define NV_MATH_H | #define NV_MATH_H | ||||
#include "nvcore/nvcore.h" | #include "nvcore/nvcore.h" | ||||
#include "nvcore/Debug.h" // nvDebugCheck | #include "nvcore/Debug.h" // nvDebugCheck | ||||
#include "nvcore/Utils.h" // max, clamp | #include "nvcore/Utils.h" // max, clamp | ||||
#include <math.h> | #include <math.h> | ||||
#if NV_OS_WIN32 || NV_OS_XBOX | #if NV_OS_WIN32 || NV_OS_XBOX | ||||
#include <float.h> // finite, isnan | #include <float.h> // finite, isnan | ||||
#endif | #endif | ||||
#if NV_CPU_X86 || NV_CPU_X86_64 | #if NV_CPU_X86 || NV_CPU_X86_64 || NV_CPU_E2K | ||||
//#include <intrin.h> | //#include <intrin.h> | ||||
#include <xmmintrin.h> | #include <xmmintrin.h> | ||||
#endif | #endif | ||||
// Function linkage | // Function linkage | ||||
#if NVMATH_SHARED | #if NVMATH_SHARED | ||||
Show All 17 Lines | |||||
#ifndef NV_USE_SSE | #ifndef NV_USE_SSE | ||||
# 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 // 1=SSE, 2=SS2 | ||||
# elif NV_CPU_E2K | |||||
// mcst-lcc compiler flags determine e2k CPU features | |||||
# if defined(__SSE2__) | |||||
# define NV_USE_SSE 2 | |||||
# elif defined(__SSE__) | |||||
# define NV_USE_SSE 1 | |||||
# else | |||||
# define NV_USE_SSE 0 | |||||
# endif | |||||
# elif defined(__SSE__) | # elif defined(__SSE__) | ||||
# define NV_USE_SSE 1 | # define NV_USE_SSE 1 | ||||
# elif defined(__SSE2__) | # elif defined(__SSE2__) | ||||
# define NV_USE_SSE 2 | # define NV_USE_SSE 2 | ||||
# else | # else | ||||
// Otherwise we assume no SSE. | // Otherwise we assume no SSE. | ||||
# define NV_USE_SSE 0 | # define NV_USE_SSE 0 | ||||
# endif | # endif | ||||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator