0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::simd: Fix 'return type cannot be vectorized' inhibition (clang).

This commit is contained in:
Jason Volk 2023-03-26 14:15:31 -07:00
parent b1c2576c20
commit 38e77c64c6

View file

@ -24,23 +24,24 @@ namespace ircd::simd
/// T = inner aligned type /// T = inner aligned type
template<class T> template<class T>
struct struct
__attribute__((packed)) [[using clang: internal_linkage, nodebug]]
__attribute__((aligned(1))) [[using gnu: packed, aligned(1), visibility("internal")]]
__attribute__((visibility("internal")))
ircd::simd::unaligned ircd::simd::unaligned
{ {
using value_type = T; using value_type = T;
T val; T val;
operator T() const [[gnu::always_inline]]
operator T() const noexcept
{ {
return val; return val;
} }
template<class U> template<class U>
unaligned(U&& val) [[gnu::always_inline]]
:val(std::forward<U>(val)) unaligned(const U val) noexcept
:val(val)
{} {}
}; };