30 #ifndef PXFOUNDATION_PXUNIXINTRINSICS_H 31 #define PXFOUNDATION_PXUNIXINTRINSICS_H 36 #if !(PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY) 37 #error "This file should only be included by Unix builds!!" 40 #if (PX_LINUX || PX_ANDROID) && !defined(__CUDACC__) && !PX_EMSCRIPTEN 64 return (a >= 0.0f) ? b : c;
70 return (a >= 0.0f) ? 1.0f : -1.0f;
94 return 1.0f / ::sqrtf(a);
99 return 1.0f / ::sqrtf(a);
117 return a < b ? a : b;
123 return a > b ? a : b;
130 union localU {
PxU32 i;
float f; } floatUnion;
132 return !((floatUnion.i & 0x7fffffff) >= 0x7f800000);
138 return !!isfinite(a);
146 return memset(dest, 0, count);
154 return memset(dest, c, count);
162 return memcpy(dest, src, count);
170 return memmove(dest, src, count);
178 PX_ASSERT(((
size_t(dest) + offset) & 0x7f) == 0);
179 memSet(reinterpret_cast<char*>(dest) + offset, 0, 128);
185 #endif // #ifndef PXFOUNDATION_PXUNIXINTRINSICS_H Definition: GuContactBuffer.h:37
PX_CUDA_CALLABLE PX_FORCE_INLINE float recip(float a)
platform-specific reciprocal
Definition: PxUnixIntrinsics.h:74
PX_CUDA_CALLABLE PX_FORCE_INLINE float sqrt(float a)
platform-specific square root
Definition: PxUnixIntrinsics.h:86
PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrt(float a)
platform-specific reciprocal square root
Definition: PxUnixIntrinsics.h:92
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:364
uint32_t PxU32
Definition: PxSimpleTypes.h:71
PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMin(float a, float b)
platform-specific minimum
Definition: PxUnixIntrinsics.h:115
PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMax(float a, float b)
platform-specific maximum
Definition: PxUnixIntrinsics.h:121
PX_FORCE_INLINE void * memCopy(void *dest, const void *src, uint32_t count)
Definition: PxUnixIntrinsics.h:160
PX_CUDA_CALLABLE PX_FORCE_INLINE float sign(float a)
platform-specific sign
Definition: PxUnixIntrinsics.h:68
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(float a)
platform-specific finiteness check (not INF or NAN)
Definition: PxUnixIntrinsics.h:127
PX_CUDA_CALLABLE PX_FORCE_INLINE float cos(float a)
platform-specific cosine
Definition: PxUnixIntrinsics.h:109
PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrtFast(float a)
Definition: PxUnixIntrinsics.h:97
PX_CUDA_CALLABLE PX_FORCE_INLINE float fsel(float a, float b, float c)
platform-specific select float
Definition: PxUnixIntrinsics.h:62
PX_CUDA_CALLABLE PX_FORCE_INLINE float abs(float a)
platform-specific absolute value
Definition: PxUnixIntrinsics.h:56
PX_FORCE_INLINE void * memMove(void *dest, const void *src, uint32_t count)
Definition: PxUnixIntrinsics.h:168
PX_CUDA_CALLABLE PX_FORCE_INLINE float recipFast(float a)
platform-specific reciprocal estimate
Definition: PxUnixIntrinsics.h:80
PX_FORCE_INLINE void * memSet(void *dest, int32_t c, uint32_t count)
Definition: PxUnixIntrinsics.h:152
PX_FORCE_INLINE void memZero128(void *dest, uint32_t offset=0)
Definition: PxUnixIntrinsics.h:176
PX_FORCE_INLINE void * memZero(void *dest, uint32_t count)
Definition: PxUnixIntrinsics.h:144
PX_CUDA_CALLABLE PX_FORCE_INLINE float sin(float a)
platform-specific sine
Definition: PxUnixIntrinsics.h:103
#define PX_ASSERT(exp)
Definition: PxAssert.h:61
#define PX_CUDA_CALLABLE
Definition: PxPreprocessor.h:473