all float3 and float4 functions and isas

completed all options of float3 and float4 functions in isas and math_c
neon still to be done but that will be on mac.
This commit is contained in:
marauder2k7 2026-02-27 11:28:51 +00:00
parent 18d0aa0418
commit f0a3251cd3
16 changed files with 593 additions and 90 deletions

View file

@ -43,6 +43,19 @@ namespace
__m128 dp = _mm_dp_ps(va, vb, 0xF1); // multiply all 4, sum all 4, lowest lane
return _mm_cvtss_f32(dp);
}
inline f32x4 v_cross(f32x4 a, f32x4 b)
{
f32x4 a_yzx = _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 0, 2, 1));
f32x4 b_yzx = _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 0, 2, 1));
f32x4 c = _mm_sub_ps(
_mm_mul_ps(a, b_yzx),
_mm_mul_ps(a_yzx, b)
);
return _mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 0, 2, 1));
}
}
#include "float4_impl.inl"
@ -64,5 +77,6 @@ namespace math_backend::float4::dispatch
gFloat4.normalize = float4_normalize_impl;
gFloat4.normalize_mag = float4_normalize_mag_impl;
gFloat4.lerp = float4_lerp_impl;
gFloat4.cross = float4_cross_impl;
}
}