mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
AK: Add generic SIMD vector load/store functions
(cherry picked from commit 27c386797df64b9c4dcbe6a27e57d9f54837e9b4)
This commit is contained in:
parent
9ee334e970
commit
873b03f661
Notes:
sideshowbarker
2024-07-18 02:44:32 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/LadybirdBrowser/ladybird/commit/873b03f6618 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/617
1 changed files with 15 additions and 0 deletions
|
@ -101,6 +101,21 @@ ALWAYS_INLINE static int maskcount(i32x4 mask)
|
|||
|
||||
// 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)
|
||||
{
|
||||
return f32x4 { *a, *b, *c, *d };
|
||||
|
|
Loading…
Add table
Reference in a new issue