mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::simd: Macro and diagnostic adjustments for GCC.
This commit is contained in:
parent
f89f15eebd
commit
8443dcf3bb
1 changed files with 11 additions and 5 deletions
|
@ -11,24 +11,28 @@
|
|||
#pragma once
|
||||
#define HAVE_IRCD_SIMD_TYPE_H
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpsabi"
|
||||
#pragma GCC diagnostic ignored "-Wpacked"
|
||||
|
||||
/// Unaligned type wrapper macro
|
||||
#define IRCD_SIMD_TYPEDEF_UNALIGNED(TYPE, NAME) \
|
||||
struct [[gnu::visibility("internal")]] \
|
||||
struct \
|
||||
__attribute__((packed)) \
|
||||
__attribute__((aligned(1))) \
|
||||
__attribute__((visibility("internal"))) \
|
||||
NAME \
|
||||
{ \
|
||||
TYPE val; \
|
||||
\
|
||||
operator TYPE () const { return val; } \
|
||||
operator TYPE &() { return val; } \
|
||||
\
|
||||
template<class T> NAME &operator=(T&& t) \
|
||||
{ \
|
||||
val = std::forward<T>(t); \
|
||||
return *this; \
|
||||
} \
|
||||
} \
|
||||
__attribute__((packed)) \
|
||||
__attribute__((aligned(1)))
|
||||
}
|
||||
|
||||
//
|
||||
// scalar
|
||||
|
@ -154,6 +158,8 @@ namespace ircd
|
|||
}
|
||||
#endif
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
//
|
||||
// other words
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue