Blender V4.3
BLI_math_vector_unroll.hh File Reference

Go to the source code of this file.

Macros

#define BLI_UNROLL_MATH_VEC_OP_VEC_VEC(op, a, b)
 
#define BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC(op, a, b)
 
#define BLI_UNROLL_MATH_VEC_OP_VEC(op, a)
 
#define BLI_UNROLL_MATH_VEC_OP_SCALAR_VEC(op, a, b)
 
#define BLI_UNROLL_MATH_VEC_OP_VEC_SCALAR(op, a, b)
 
#define BLI_UNROLL_MATH_VEC_OP_ASSIGN_VEC(op, b)
 
#define BLI_UNROLL_MATH_VEC_OP_ASSIGN_SCALAR(op, b)
 
#define BLI_UNROLL_MATH_VEC_OP_INIT_INDEX(a)
 
#define BLI_UNROLL_MATH_VEC_OP_INIT_VECTOR(a)
 

Macro Definition Documentation

◆ BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC

#define BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC ( op,
a,
b )
Value:
if constexpr (Size == 4) { \
return VecBase<T, Size>(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w)); \
} \
else if constexpr (Size == 3) { \
return VecBase<T, Size>(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z)); \
} \
else if constexpr (Size == 2) { \
return VecBase<T, Size>(op(a.x, b.x), op(a.y, b.y)); \
} \
else { \
VecBase<T, Size> result; \
for (int i = 0; i < Size; i++) { \
result[i] = op(a[i], b[i]); \
} \
return result; \
}
local_group_size(16, 16) .push_constant(Type b

Definition at line 42 of file BLI_math_vector_unroll.hh.

Referenced by blender::math::max(), blender::math::min(), blender::math::mod(), blender::math::pow(), blender::math::safe_divide(), blender::math::safe_mod(), and blender::math::step().

◆ BLI_UNROLL_MATH_VEC_OP_ASSIGN_SCALAR

#define BLI_UNROLL_MATH_VEC_OP_ASSIGN_SCALAR ( op,
b )
Value:
if constexpr (Size == 4) { \
this->x op b; \
this->y op b; \
this->z op b; \
this->w op b; \
} \
else if constexpr (Size == 3) { \
this->x op b; \
this->y op b; \
this->z op b; \
} \
else if constexpr (Size == 2) { \
this->x op b; \
this->y op b; \
} \
else { \
for (int i = 0; i < Size; i++) { \
(*this)[i] op b; \
} \
} \
return *this
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119

Definition at line 142 of file BLI_math_vector_unroll.hh.

Referenced by blender::VecBase< T, Size >::operator*=(), blender::VecBase< T, Size >::operator+=(), blender::VecBase< T, Size >::operator-=(), and blender::VecBase< T, Size >::operator/=().

◆ BLI_UNROLL_MATH_VEC_OP_ASSIGN_VEC

#define BLI_UNROLL_MATH_VEC_OP_ASSIGN_VEC ( op,
b )
Value:
if constexpr (Size == 4) { \
this->x op b.x; \
this->y op b.y; \
this->z op b.z; \
this->w op b.w; \
} \
else if constexpr (Size == 3) { \
this->x op b.x; \
this->y op b.y; \
this->z op b.z; \
} \
else if constexpr (Size == 2) { \
this->x op b.x; \
this->y op b.y; \
} \
else { \
for (int i = 0; i < Size; i++) { \
(*this)[i] op b[i]; \
} \
} \
return *this

Definition at line 118 of file BLI_math_vector_unroll.hh.

Referenced by blender::VecBase< T, Size >::operator*=(), blender::VecBase< T, Size >::operator+=(), blender::VecBase< T, Size >::operator-=(), and blender::VecBase< T, Size >::operator/=().

◆ BLI_UNROLL_MATH_VEC_OP_INIT_INDEX

#define BLI_UNROLL_MATH_VEC_OP_INIT_INDEX ( a)
Value:
if constexpr (Size == 4) { \
this->x = a[0]; \
this->y = a[1]; \
this->z = a[2]; \
this->w = a[3]; \
} \
else if constexpr (Size == 3) { \
this->x = a[0]; \
this->y = a[1]; \
this->z = a[2]; \
} \
else if constexpr (Size == 2) { \
this->x = a[0]; \
this->y = a[1]; \
} \
else { \
for (int i = 0; i < Size; i++) { \
(*this)[i] = a[i]; \
} \
}

Definition at line 166 of file BLI_math_vector_unroll.hh.

Referenced by blender::VecBase< T, Size >::VecBase(), and blender::VecBase< T, Size >::VecBase().

◆ BLI_UNROLL_MATH_VEC_OP_INIT_VECTOR

#define BLI_UNROLL_MATH_VEC_OP_INIT_VECTOR ( a)
Value:
if constexpr (Size == 4) { \
this->x = T(a.x); \
this->y = T(a.y); \
this->z = T(a.z); \
this->w = T(a.w); \
} \
else if constexpr (Size == 3) { \
this->x = T(a.x); \
this->y = T(a.y); \
this->z = T(a.z); \
} \
else if constexpr (Size == 2) { \
this->x = T(a.x); \
this->y = T(a.y); \
} \
else { \
for (int i = 0; i < Size; i++) { \
(*this)[i] = T(a[i]); \
} \
}
#define T

Definition at line 189 of file BLI_math_vector_unroll.hh.

Referenced by blender::VecBase< T, Size >::VecBase().

◆ BLI_UNROLL_MATH_VEC_OP_SCALAR_VEC

#define BLI_UNROLL_MATH_VEC_OP_SCALAR_VEC ( op,
a,
b )
Value:
if constexpr (Size == 4) { \
return VecBase<T, Size>(a op b.x, a op b.y, a op b.z, a op b.w); \
} \
else if constexpr (Size == 3) { \
return VecBase<T, Size>(a op b.x, a op b.y, a op b.z); \
} \
else if constexpr (Size == 2) { \
return VecBase<T, Size>(a op b.x, a op b.y); \
} \
else { \
VecBase<T, Size> result; \
for (int i = 0; i < Size; i++) { \
result[i] = a op b[i]; \
} \
return result; \
}

Definition at line 80 of file BLI_math_vector_unroll.hh.

Referenced by blender::VecBase< T, Size >::BLI_INT_OP().

◆ BLI_UNROLL_MATH_VEC_OP_VEC

#define BLI_UNROLL_MATH_VEC_OP_VEC ( op,
a )
Value:
if constexpr (Size == 4) { \
return VecBase<T, Size>(op(a.x), op(a.y), op(a.z), op(a.w)); \
} \
else if constexpr (Size == 3) { \
return VecBase<T, Size>(op(a.x), op(a.y), op(a.z)); \
} \
else if constexpr (Size == 2) { \
return VecBase<T, Size>(op(a.x), op(a.y)); \
} \
else { \
VecBase<T, Size> result; \
for (int i = 0; i < Size; i++) { \
result[i] = op(a[i]); \
} \
return result; \
}

Definition at line 61 of file BLI_math_vector_unroll.hh.

Referenced by blender::math::ceil(), blender::math::exp(), blender::math::floor(), blender::math::fract(), blender::math::rcp(), blender::math::round(), blender::math::safe_rcp(), blender::math::sign(), blender::math::sqrt(), and blender::math::square().

◆ BLI_UNROLL_MATH_VEC_OP_VEC_SCALAR

#define BLI_UNROLL_MATH_VEC_OP_VEC_SCALAR ( op,
a,
b )
Value:
if constexpr (Size == 4) { \
return VecBase<T, Size>(a.x op b, a.y op b, a.z op b, a.w op b); \
} \
else if constexpr (Size == 3) { \
return VecBase<T, Size>(a.x op b, a.y op b, a.z op b); \
} \
else if constexpr (Size == 2) { \
return VecBase<T, Size>(a.x op b, a.y op b); \
} \
else { \
VecBase<T, Size> result; \
for (int i = 0; i < Size; i++) { \
result[i] = a[i] op b; \
} \
return result; \
}

Definition at line 99 of file BLI_math_vector_unroll.hh.

◆ BLI_UNROLL_MATH_VEC_OP_VEC_VEC

#define BLI_UNROLL_MATH_VEC_OP_VEC_VEC ( op,
a,
b )
Value:
if constexpr (Size == 4) { \
return VecBase<T, Size>(a.x op b.x, a.y op b.y, a.z op b.z, a.w op b.w); \
} \
else if constexpr (Size == 3) { \
return VecBase<T, Size>(a.x op b.x, a.y op b.y, a.z op b.z); \
} \
else if constexpr (Size == 2) { \
return VecBase<T, Size>(a.x op b.x, a.y op b.y); \
} \
else { \
VecBase<T, Size> result; \
for (int i = 0; i < Size; i++) { \
result[i] = a[i] op b[i]; \
} \
return result; \
}

Definition at line 23 of file BLI_math_vector_unroll.hh.