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:
parent
b1c2576c20
commit
38e77c64c6
1 changed files with 7 additions and 6 deletions
|
@ -24,23 +24,24 @@ namespace ircd::simd
|
|||
/// T = inner aligned type
|
||||
template<class T>
|
||||
struct
|
||||
__attribute__((packed))
|
||||
__attribute__((aligned(1)))
|
||||
__attribute__((visibility("internal")))
|
||||
[[using clang: internal_linkage, nodebug]]
|
||||
[[using gnu: packed, aligned(1), visibility("internal")]]
|
||||
ircd::simd::unaligned
|
||||
{
|
||||
using value_type = T;
|
||||
|
||||
T val;
|
||||
|
||||
operator T() const
|
||||
[[gnu::always_inline]]
|
||||
operator T() const noexcept
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
unaligned(U&& val)
|
||||
:val(std::forward<U>(val))
|
||||
[[gnu::always_inline]]
|
||||
unaligned(const U val) noexcept
|
||||
:val(val)
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue