mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-23 22:29:28 +00:00
further sse simd additions
avx2 float3 added added normalize_magnitude added divide fast to float3 may copy to float4 move static spheremesh to drawSphere (initialize on first use) so platform has a chance to load the math backend
This commit is contained in:
parent
2559145c06
commit
18d0aa0418
16 changed files with 337 additions and 77 deletions
38
Engine/source/math/public/float3_dispatch.h
Normal file
38
Engine/source/math/public/float3_dispatch.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
#ifndef _FLOAT3_DISPATCH_H_
|
||||
#define _FLOAT3_DISPATCH_H_
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace math_backend::float3::dispatch
|
||||
{
|
||||
struct Float3Funcs
|
||||
{
|
||||
void (*add)(const float*, const float*, float*) = nullptr;
|
||||
void (*sub)(const float*, const float*, float*) = nullptr;
|
||||
void (*mul)(const float*, const float*, float*) = nullptr;
|
||||
void (*mul_scalar)(const float*, float, float*) = nullptr;
|
||||
void (*div)(const float*, const float*, float*) = nullptr;
|
||||
void (*div_scalar)(const float*, float, float*) = nullptr;
|
||||
float (*dot)(const float*, const float*) = nullptr;
|
||||
float (*length)(const float*) = nullptr;
|
||||
float (*lengthSquared)(const float*) = nullptr;
|
||||
void (*normalize)(float*) = nullptr;
|
||||
void (*normalize_mag)(float*, float) = nullptr;
|
||||
void (*lerp)(const float*, const float*, float, float*) = nullptr;
|
||||
};
|
||||
|
||||
// Global dispatch table
|
||||
extern Float3Funcs gFloat3;
|
||||
|
||||
// Backend installers (defined in ISA libraries)
|
||||
void install_scalar();
|
||||
void install_sse2();
|
||||
void install_sse41();
|
||||
void install_avx();
|
||||
void install_avx2();
|
||||
void install_neon();
|
||||
}
|
||||
|
||||
#endif // !_FLOAT4_DISPATCH_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue