mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-20 12:50:57 +00:00
Test simd math functions for float4 values
beginning implementation of float4 simd functions for x64 and neon
This commit is contained in:
parent
a7d92c344d
commit
6406ca1832
8 changed files with 305 additions and 389 deletions
|
|
@ -37,6 +37,39 @@
|
|||
|
||||
extern void MathConsoleInit();
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Runtime ISA detection enum for x86
|
||||
enum class ISA {
|
||||
NONE = 0,
|
||||
SSE2,
|
||||
SSE41,
|
||||
AVX,
|
||||
AVX2
|
||||
};
|
||||
|
||||
// Global variable storing detected ISA
|
||||
extern ISA gISA;
|
||||
//------------------------------------------------------------------------------
|
||||
// Forward declare math_backend
|
||||
namespace math_backend {
|
||||
namespace float4 {
|
||||
void add(const float* a, const float* b, float* r);
|
||||
void sub(const float* a, const float* b, float* r);
|
||||
void mul(const float* a, const float* b, float* r);
|
||||
void mul_scalar(const float* a, float s, float* r);
|
||||
void div(const float* a, const float* b, float* r);
|
||||
void div_scalar(const float* a, float s, float* r);
|
||||
float dot(const float* a, const float* b);
|
||||
void lerp(const float* from, const float* to, float f, float* r);
|
||||
|
||||
void addArray(const class Point4F* a, const class Point4F* b, class Point4F* r, size_t n);
|
||||
void subArray(const class Point4F* a, const class Point4F* b, class Point4F* r, size_t n);
|
||||
void mulArray(const class Point4F* a, const class Point4F* b, class Point4F* r, size_t n);
|
||||
void mulArrayScalar(const class Point4F* a, float s, class Point4F* r, size_t n);
|
||||
void lerpArray(const class Point4F* from, const class Point4F* to, float f, class Point4F* r, size_t n);
|
||||
}
|
||||
} // namespace math_backend
|
||||
|
||||
//--------------------------------------
|
||||
// Installable Library Prototypes
|
||||
extern S32 (*m_mulDivS32)(S32 a, S32 b, S32 c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue