mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
AK: Add generic SIMD vector load/store functions
(cherry picked from commit 27c386797df64b9c4dcbe6a27e57d9f54837e9b4)
This commit is contained in:
committed by
Andrew Kaster
parent
9ee334e970
commit
873b03f661
@@ -101,6 +101,21 @@ ALWAYS_INLINE static int maskcount(i32x4 mask)
|
|||||||
|
|
||||||
// Load / Store
|
// Load / Store
|
||||||
|
|
||||||
|
template<SIMDVector VectorType>
|
||||||
|
ALWAYS_INLINE static VectorType load_unaligned(void const* a)
|
||||||
|
{
|
||||||
|
VectorType v;
|
||||||
|
__builtin_memcpy(&v, a, sizeof(VectorType));
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<SIMDVector VectorType>
|
||||||
|
ALWAYS_INLINE static void store_unaligned(void* a, VectorType const& v)
|
||||||
|
{
|
||||||
|
// FIXME: Does this generate the right instructions?
|
||||||
|
__builtin_memcpy(a, &v, sizeof(VectorType));
|
||||||
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE static f32x4 load4(float const* a, float const* b, float const* c, float const* d)
|
ALWAYS_INLINE static f32x4 load4(float const* a, float const* b, float const* c, float const* d)
|
||||||
{
|
{
|
||||||
return f32x4 { *a, *b, *c, *d };
|
return f32x4 { *a, *b, *c, *d };
|
||||||
|
|||||||
Reference in New Issue
Block a user