0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-08 13:08:56 +02:00

ircd::simd: Macro and diagnostic adjustments for GCC.

This commit is contained in:
Jason Volk 2020-08-09 07:41:48 -07:00
parent f89f15eebd
commit 8443dcf3bb

View file

@ -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
//