mirror of
https://github.com/matrix-construct/construct
synced 2025-01-15 09:06:50 +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
|
#pragma once
|
||||||
#define HAVE_IRCD_SIMD_TYPE_H
|
#define HAVE_IRCD_SIMD_TYPE_H
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wpsabi"
|
||||||
|
#pragma GCC diagnostic ignored "-Wpacked"
|
||||||
|
|
||||||
/// Unaligned type wrapper macro
|
/// Unaligned type wrapper macro
|
||||||
#define IRCD_SIMD_TYPEDEF_UNALIGNED(TYPE, NAME) \
|
#define IRCD_SIMD_TYPEDEF_UNALIGNED(TYPE, NAME) \
|
||||||
struct [[gnu::visibility("internal")]] \
|
struct \
|
||||||
|
__attribute__((packed)) \
|
||||||
|
__attribute__((aligned(1))) \
|
||||||
|
__attribute__((visibility("internal"))) \
|
||||||
NAME \
|
NAME \
|
||||||
{ \
|
{ \
|
||||||
TYPE val; \
|
TYPE val; \
|
||||||
\
|
\
|
||||||
operator TYPE () const { return val; } \
|
operator TYPE () const { return val; } \
|
||||||
operator TYPE &() { return val; } \
|
|
||||||
\
|
\
|
||||||
template<class T> NAME &operator=(T&& t) \
|
template<class T> NAME &operator=(T&& t) \
|
||||||
{ \
|
{ \
|
||||||
val = std::forward<T>(t); \
|
val = std::forward<T>(t); \
|
||||||
return *this; \
|
return *this; \
|
||||||
} \
|
} \
|
||||||
} \
|
}
|
||||||
__attribute__((packed)) \
|
|
||||||
__attribute__((aligned(1)))
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// scalar
|
// scalar
|
||||||
|
@ -154,6 +158,8 @@ namespace ircd
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
//
|
//
|
||||||
// other words
|
// other words
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue