2010-11-09 03:38:03 +00:00
|
|
|
|
// This code is in the public domain -- Ignacio Casta<74>o <castano@gmail.com>
|
|
|
|
|
|
|
|
|
|
#include "Vector.h" // Vector3, Vector4
|
|
|
|
|
|
|
|
|
|
// Set some reasonable defaults.
|
|
|
|
|
#ifndef NV_USE_ALTIVEC
|
2010-11-09 19:34:45 +00:00
|
|
|
|
# define NV_USE_ALTIVEC NV_CPU_PPC
|
2012-01-01 21:29:27 +00:00
|
|
|
|
//# define NV_USE_ALTIVEC defined(__VEC__)
|
2010-11-09 03:38:03 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef NV_USE_SSE
|
|
|
|
|
# if NV_CPU_X86 || NV_CPU_X86_64
|
|
|
|
|
# define NV_USE_SSE 2
|
|
|
|
|
# endif
|
2012-01-12 16:54:10 +00:00
|
|
|
|
//# if defined(__SSE2__)
|
|
|
|
|
//# define NV_USE_SSE 2
|
|
|
|
|
//# elif defined(__SSE__)
|
|
|
|
|
//# define NV_USE_SSE 1
|
|
|
|
|
//# else
|
|
|
|
|
//# define NV_USE_SSE 0
|
|
|
|
|
//# endif
|
2010-11-09 03:38:03 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2012-01-12 16:54:10 +00:00
|
|
|
|
// Internally set NV_USE_SIMD when either altivec or sse is available.
|
|
|
|
|
#if NV_USE_ALTIVEC && NV_USE_SSE
|
|
|
|
|
# error "Cannot enable both altivec and sse!"
|
|
|
|
|
#endif
|
2010-11-09 03:38:03 +00:00
|
|
|
|
|
|
|
|
|
#if NV_USE_ALTIVEC
|
|
|
|
|
# include "SimdVector_VE.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if NV_USE_SSE
|
|
|
|
|
# include "SimdVector_SSE.h"
|
|
|
|
|
#endif
|