mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-19 04:10:54 +00:00
math backend setup
setup libraries for different simd isa's add float4 functions for c sse2 and avx2 (placeholder file for neon to be implemented on mac)
This commit is contained in:
parent
b6ea96f367
commit
e9fdffc2dd
9 changed files with 386 additions and 2 deletions
7
Engine/source/math/public/float4_dispatch.cpp
Normal file
7
Engine/source/math/public/float4_dispatch.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include "math/public/float4_dispatch.h"
|
||||
|
||||
namespace math_backend::float4::dispatch
|
||||
{
|
||||
// Single definition of the global dispatch table
|
||||
Float4Funcs gFloat4{};
|
||||
}
|
||||
34
Engine/source/math/public/float4_dispatch.h
Normal file
34
Engine/source/math/public/float4_dispatch.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace math_backend::float4::dispatch
|
||||
{
|
||||
struct Float4Funcs
|
||||
{
|
||||
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 (*lerp)(const float*, const float*, float, float*) = nullptr;
|
||||
};
|
||||
|
||||
// Global dispatch table
|
||||
extern Float4Funcs gFloat4;
|
||||
|
||||
// Backend installers (defined in ISA libraries)
|
||||
void install_scalar();
|
||||
void install_sse2();
|
||||
void install_sse41();
|
||||
void install_avx();
|
||||
void install_avx2();
|
||||
void install_neon();
|
||||
|
||||
// Centralized installer (engine calls this once)
|
||||
void install_preferred();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue