Back to index

supertuxkart  0.5+dfsg1
Defines | Typedefs | Functions
btOdeMacros.h File Reference
#include "LinearMath/btScalar.h"
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ODE_MACROS
#define dInfinity   FLT_MAX
#define dRecip(x)   ((float)(1.0f/(x))) /* reciprocal */
#define dMULTIPLY0_331NEW(A, op, B, C)
#define dMULTIPLY0_331(A, B, C)   dMULTIPLYOP0_331(A,=,B,C)
#define dMULTIPLYOP0_331(A, op, B, C)
#define dAASSERT   btAssert
#define dIASSERT   btAssert
#define REAL   float
#define dDOTpq(a, b, p, q)   ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])
#define dDOT14(a, b)   dDOTpq(a,b,1,4)
#define dCROSS(a, op, b, c)
#define dCROSSMAT(A, a, skip, plus, minus)
#define dMULTIPLYOP2_333(A, op, B, C)
#define dMULTIPLYOP0_333(A, op, B, C)
#define dMULTIPLY2_333(A, B, C)   dMULTIPLYOP2_333(A,=,B,C)
#define dMULTIPLY0_333(A, B, C)   dMULTIPLYOP0_333(A,=,B,C)
#define dMULTIPLYADD0_331(A, B, C)   dMULTIPLYOP0_331(A,+=,B,C)
#define EFFICIENT_ALIGNMENT   16
#define dEFFICIENT_SIZE(x)   ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)
#define dALLOCA16(n)   ((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))
#define ALLOCA(size)   stackAlloc->allocate( dEFFICIENT_SIZE(size) );
#define dRealAllocaArray(name, size)
#define IS_ALIGNED_16(x)   ((size_t(x)&15)==0)
 This macros are for MSVC and XCode compilers. Remotion.

Typedefs

typedef btScalar dVector4 [4]
typedef btScalar dMatrix3 [4 *3]
typedef const btScalardRealPtr
typedef btScalardRealMutablePtr

Functions

btScalar dDOT1 (const btScalar *a, const btScalar *b)
void dSetZero1 (btScalar *dest, int size)
void dSetValue1 (btScalar *dest, int size, btScalar val)

Define Documentation

#define ALLOCA (   size)    stackAlloc->allocate( dEFFICIENT_SIZE(size) );

Definition at line 129 of file btOdeMacros.h.

#define dAASSERT   btAssert

Definition at line 49 of file btOdeMacros.h.

#define dALLOCA16 (   n)    ((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))

Definition at line 116 of file btOdeMacros.h.

#define dCROSS (   a,
  op,
  b,
 
)
Value:
(a)[0] op ((b)[1]*(c)[2] - (b)[2]*(c)[1]); \
  (a)[1] op ((b)[2]*(c)[0] - (b)[0]*(c)[2]); \
  (a)[2] op ((b)[0]*(c)[1] - (b)[1]*(c)[0]);

Definition at line 58 of file btOdeMacros.h.

#define dCROSSMAT (   A,
  a,
  skip,
  plus,
  minus 
)
Value:
do { \
  (A)[1] = minus (a)[2]; \
  (A)[2] = plus (a)[1]; \
  (A)[(skip)+0] = plus (a)[2]; \
  (A)[(skip)+2] = minus (a)[0]; \
  (A)[2*(skip)+0] = minus (a)[1]; \
  (A)[2*(skip)+1] = plus (a)[0]; \
} while(0)

Definition at line 71 of file btOdeMacros.h.

#define dDOT14 (   a,
 
)    dDOTpq(a,b,1,4)

Definition at line 56 of file btOdeMacros.h.

#define dDOTpq (   a,
  b,
  p,
 
)    ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])

Definition at line 53 of file btOdeMacros.h.

#define dEFFICIENT_SIZE (   x)    ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)

Definition at line 111 of file btOdeMacros.h.

#define dIASSERT   btAssert

Definition at line 50 of file btOdeMacros.h.

#define dInfinity   FLT_MAX

Definition at line 26 of file btOdeMacros.h.

#define dMULTIPLY0_331 (   A,
  B,
 
)    dMULTIPLYOP0_331(A,=,B,C)

Definition at line 43 of file btOdeMacros.h.

#define dMULTIPLY0_331NEW (   A,
  op,
  B,
 
)
Value:
{\
	btScalar tmp[3];\
       tmp[0] = C.getX();\
       tmp[1] = C.getY();\
       tmp[2] = C.getZ();\
       dMULTIPLYOP0_331(A,op,B,tmp);\
}

Definition at line 34 of file btOdeMacros.h.

#define dMULTIPLY0_333 (   A,
  B,
 
)    dMULTIPLYOP0_333(A,=,B,C)

Definition at line 105 of file btOdeMacros.h.

#define dMULTIPLY2_333 (   A,
  B,
 
)    dMULTIPLYOP2_333(A,=,B,C)

Definition at line 104 of file btOdeMacros.h.

#define dMULTIPLYADD0_331 (   A,
  B,
 
)    dMULTIPLYOP0_331(A,+=,B,C)

Definition at line 106 of file btOdeMacros.h.

#define dMULTIPLYOP0_331 (   A,
  op,
  B,
 
)
Value:
(A)[0] op dDOT1((B),(C)); \
  (A)[1] op dDOT1((B+4),(C)); \
  (A)[2] op dDOT1((B+8),(C));

Definition at line 44 of file btOdeMacros.h.

#define dMULTIPLYOP0_333 (   A,
  op,
  B,
 
)
Value:
(A)[0] op dDOT14((B),(C)); \
  (A)[1] op dDOT14((B),(C+1)); \
  (A)[2] op dDOT14((B),(C+2)); \
  (A)[4] op dDOT14((B+4),(C)); \
  (A)[5] op dDOT14((B+4),(C+1)); \
  (A)[6] op dDOT14((B+4),(C+2)); \
  (A)[8] op dDOT14((B+8),(C)); \
  (A)[9] op dDOT14((B+8),(C+1)); \
  (A)[10] op dDOT14((B+8),(C+2));

Definition at line 93 of file btOdeMacros.h.

#define dMULTIPLYOP2_333 (   A,
  op,
  B,
 
)
Value:
(A)[0] op dDOT1((B),(C)); \
  (A)[1] op dDOT1((B),(C+4)); \
  (A)[2] op dDOT1((B),(C+8)); \
  (A)[4] op dDOT1((B+4),(C)); \
  (A)[5] op dDOT1((B+4),(C+4)); \
  (A)[6] op dDOT1((B+4),(C+8)); \
  (A)[8] op dDOT1((B+8),(C)); \
  (A)[9] op dDOT1((B+8),(C+4)); \
  (A)[10] op dDOT1((B+8),(C+8));

Definition at line 82 of file btOdeMacros.h.

#define dRealAllocaArray (   name,
  size 
)
Value:
btScalar *name = NULL; \
       int memNeeded_##name = dEFFICIENT_SIZE(size)*sizeof(btScalar); \
       if (memNeeded_##name < stackAlloc->getAvailableMemory()) name = (btScalar*) stackAlloc->allocate(memNeeded_##name); \
       else{ btAssert(memNeeded_##name < stackAlloc->getAvailableMemory()); name = (btScalar*) alloca(memNeeded_##name); }

Definition at line 132 of file btOdeMacros.h.

#define dRecip (   x)    ((float)(1.0f/(x))) /* reciprocal */

Definition at line 30 of file btOdeMacros.h.

#define EFFICIENT_ALIGNMENT   16

Definition at line 110 of file btOdeMacros.h.

#define IS_ALIGNED_16 (   x)    ((size_t(x)&15)==0)

This macros are for MSVC and XCode compilers. Remotion.

Definition at line 169 of file btOdeMacros.h.

#define ODE_MACROS

Definition at line 19 of file btOdeMacros.h.

#define REAL   float

Definition at line 52 of file btOdeMacros.h.


Typedef Documentation

typedef btScalar dMatrix3[4 *3]

Definition at line 25 of file btOdeMacros.h.

Definition at line 122 of file btOdeMacros.h.

typedef const btScalar* dRealPtr

Definition at line 121 of file btOdeMacros.h.

typedef btScalar dVector4[4]

Definition at line 24 of file btOdeMacros.h.


Function Documentation

btScalar dDOT1 ( const btScalar a,
const btScalar b 
) [inline]

Definition at line 54 of file btOdeMacros.h.

{ return dDOTpq(a,b,1,1); }
void dSetValue1 ( btScalar dest,
int  size,
btScalar  val 
) [inline]

Definition at line 177 of file btOdeMacros.h.

{
       dAASSERT (dest && size >= 0);
       int n_mod4 = size & 3;             
       int n4 = size - n_mod4;
/*#ifdef __USE_SSE__
//it is not supported on double precision, todo...
       if(IS_ALIGNED_16(dest)){
              __m128 xmm0 = _mm_set_ps1(val);
              for (int i=0; i<n4; i+=4)
              {
                     _mm_store_ps(&dest[i],xmm0);
              }
       }else
#endif
       */

       {
              for (int i=0; i<n4; i+=4) // Unrolled Loop
              {
                     dest[i  ] = val;
                     dest[i+1] = val;
                     dest[i+2] = val;
                     dest[i+3] = val;
              }
       }
       for (int  i=n4; i<size; i++){
              dest[i] = val;
       }
}

Here is the caller graph for this function:

void dSetZero1 ( btScalar dest,
int  size 
) [inline]

Definition at line 171 of file btOdeMacros.h.

{
       dAASSERT (dest && size >= 0);
       memset(dest, 0, size * sizeof(btScalar));
}

Here is the caller graph for this function: