Go to the documentation of this file.
21 #ifdef TF2_MANAGED_CODE
33 #if defined(DEBUG) || defined (_DEBUG)
40 #if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
42 #define TF2SIMD_FORCE_INLINE inline
43 #define ATTRIBUTE_ALIGNED16(a) a
44 #define ATTRIBUTE_ALIGNED64(a) a
45 #define ATTRIBUTE_ALIGNED128(a) a
48 #pragma warning(disable : 4324) // disable padding warning
53 #define TF2SIMD_FORCE_INLINE __forceinline
54 #define ATTRIBUTE_ALIGNED16(a) __declspec(align(16)) a
55 #define ATTRIBUTE_ALIGNED64(a) __declspec(align(64)) a
56 #define ATTRIBUTE_ALIGNED128(a) __declspec (align(128)) a
58 #define TF2_USE_VMX128
60 #include <ppcintrinsics.h>
61 #define TF2_HAVE_NATIVE_FSEL
62 #define tf2Fsel(a,b,c) __fsel((a),(b),(c))
72 #define tf2Assert assert
77 #define tf2FullAssert(x)
79 #define tf2Likely(_c) _c
80 #define tf2Unlikely(_c) _c
84 #if defined (__CELLOS_LV2__)
85 #define TF2SIMD_FORCE_INLINE inline
86 #define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
87 #define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
88 #define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
93 #define tf2Assert assert
98 #define tf2FullAssert(x)
100 #define tf2Likely(_c) _c
101 #define tf2Unlikely(_c) _c
107 #define TF2SIMD_FORCE_INLINE __inline
108 #define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
109 #define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
110 #define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
115 #define tf2Assert assert
120 #define tf2FullAssert(x)
123 #define tf2Likely(_c) __builtin_expect((_c), 1)
124 #define tf2Unlikely(_c) __builtin_expect((_c), 0)
130 #define TF2SIMD_FORCE_INLINE inline
131 #define ATTRIBUTE_ALIGNED16(a) a
136 #define ATTRIBUTE_ALIGNED64(a) a
137 #define ATTRIBUTE_ALIGNED128(a) a
142 #if defined(DEBUG) || defined (_DEBUG)
143 #define tf2Assert assert
149 #define tf2FullAssert(x)
150 #define tf2Likely(_c) _c
151 #define tf2Unlikely(_c) _c
155 #endif //__CELLOS_LV2__
162 #define TF2_LARGE_FLOAT 1e30
165 #define TF2_DECLARE_ALIGNED_ALLOCATOR() \
166 TF2SIMD_FORCE_INLINE void* operator new(size_t sizeInBytes) { return tf2AlignedAlloc(sizeInBytes,16); } \
167 TF2SIMD_FORCE_INLINE void operator delete(void* ptr) { tf2AlignedFree(ptr); } \
168 TF2SIMD_FORCE_INLINE void* operator new(size_t, void* ptr) { return ptr; } \
169 TF2SIMD_FORCE_INLINE void operator delete(void*, void*) { } \
170 TF2SIMD_FORCE_INLINE void* operator new[](size_t sizeInBytes) { return tf2AlignedAlloc(sizeInBytes,16); } \
171 TF2SIMD_FORCE_INLINE void operator delete[](void* ptr) { tf2AlignedFree(ptr); } \
172 TF2SIMD_FORCE_INLINE void* operator new[](size_t, void* ptr) { return ptr; } \
173 TF2SIMD_FORCE_INLINE void operator delete[](void*, void*) { } \
193 #define TF2SIMD_2_PI tf2Scalar(6.283185307179586232)
194 #define TF2SIMD_PI (TF2SIMD_2_PI * tf2Scalar(0.5))
195 #define TF2SIMD_HALF_PI (TF2SIMD_2_PI * tf2Scalar(0.25))
196 #define TF2SIMD_RADS_PER_DEG (TF2SIMD_2_PI / tf2Scalar(360.0))
197 #define TF2SIMD_DEGS_PER_RAD (tf2Scalar(360.0) / TF2SIMD_2_PI)
198 #define TF2SIMDSQRT12 tf2Scalar(0.7071067811865475244008443621048490)
200 #define tf2RecipSqrt(x) ((tf2Scalar)(tf2Scalar(1.0)/tf2Sqrt(tf2Scalar(x))))
203 #define TF2SIMD_EPSILON DBL_EPSILON
204 #define TF2SIMD_INFINITY DBL_MAX
214 angle = coeff_1 - coeff_1 * r;
217 angle = coeff_2 - coeff_1 * r;
225 return (((a) <= eps) && !((a) < -eps));
228 return (!((a) <= eps));
239 #define TF2_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
244 return a >= 0 ? b :
c;
247 #define tf2Fsels(a,b,c) (tf2Scalar)tf2Fsel(a,b,c)
253 const char *p = (
const char *) &i;
270 unsigned testNz = (unsigned)(((
int)condition | -(
int)condition) >> 31);
271 unsigned testEqz = ~testNz;
272 return ((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz));
276 unsigned testNz = (unsigned)(((
int)condition | -(
int)condition) >> 31);
277 unsigned testEqz = ~testNz;
278 return static_cast<int>((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz));
282 #ifdef TF2_HAVE_NATIVE_FSEL
285 return (condition != 0) ? valueIfConditionNonZero : valueIfConditionZero;
300 return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24));
305 return static_cast<unsigned short>(((val & 0xff00) >> 8) | ((val & 0x00ff) << 8));
327 unsigned char *dst = (
unsigned char *)&a;
328 unsigned char *src = (
unsigned char *)&
d;
341 unsigned char *src = (
unsigned char *)&a;
342 unsigned char *dst = (
unsigned char *)&
d;
356 unsigned char *src = (
unsigned char *)&
d;
373 unsigned char *dst = (
unsigned char *)&
d;
401 return angleInRadians;
418 #endif //TF2SIMD___SCALAR_H
TF2SIMD_FORCE_INLINE tf2Scalar tf2Asin(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Atan2(tf2Scalar x, tf2Scalar y)
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
TF2SIMD_FORCE_INLINE bool tf2MachineIsLittleEndian()
TF2SIMD_FORCE_INLINE tf2Scalar tf2Radians(tf2Scalar x)
TF2SIMD_FORCE_INLINE bool tf2Equal(tf2Scalar a, tf2Scalar eps)
TF2SIMD_FORCE_INLINE unsigned tf2SwapEndian(unsigned val)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Sin(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Fmod(tf2Scalar x, tf2Scalar y)
TF2SIMD_FORCE_INLINE void tf2Swap(T &a, T &b)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Sqrt(tf2Scalar x)
#define TF2SIMD_RADS_PER_DEG
TF2SIMD_FORCE_INLINE tf2Scalar tf2Degrees(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Acos(tf2Scalar x)
TF2SIMD_FORCE_INLINE float tf2UnswapEndianFloat(unsigned int a)
TF2SIMD_FORCE_INLINE tf2Scalar tf2NormalizeAngle(tf2Scalar angleInRadians)
TF2SIMD_FORCE_INLINE double tf2UnswapEndianDouble(const unsigned char *src)
#define TF2SIMD_FORCE_INLINE
int getObjectType() const
TF2SIMD_FORCE_INLINE unsigned tf2Select(unsigned condition, unsigned valueIfConditionNonZero, unsigned valueIfConditionZero)
TF2SIMD_FORCE_INLINE bool tf2FuzzyZero(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Atan(tf2Scalar x)
tf2TypedObject(int objectType)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Tan(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Cos(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Atan2Fast(tf2Scalar y, tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Fsel(tf2Scalar a, tf2Scalar b, tf2Scalar c)
TF2SIMD_FORCE_INLINE unsigned int tf2SwapEndianFloat(float d)
tf2SwapFloat uses using char pointers to swap the endianness
TF2SIMD_FORCE_INLINE void tf2SwapEndianDouble(double d, unsigned char *dst)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Fabs(tf2Scalar x)
TF2SIMD_FORCE_INLINE bool tf2GreaterEqual(tf2Scalar a, tf2Scalar eps)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Log(tf2Scalar x)
rudimentary class to provide type info
double tf2Scalar
The tf2Scalar type abstracts floating point numbers, to easily switch between double and single float...
#define TF2SIMD_DEGS_PER_RAD
TF2SIMD_FORCE_INLINE tf2Scalar tf2Pow(tf2Scalar x, tf2Scalar y)
TF2SIMD_FORCE_INLINE int tf2IsNegative(tf2Scalar x)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Exp(tf2Scalar x)
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:10