mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-09 15:12:35 -04:00
Introduce simd32_t type.
Discontinue use of disagreeable __SIMD #define.
This commit is contained in:
parent
1986d1faca
commit
05eb694c0a
5 changed files with 83 additions and 60 deletions
|
@ -28,6 +28,30 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
template<typename T>
|
||||
struct simd32_t {
|
||||
union {
|
||||
uint32_t raw;
|
||||
T vec;
|
||||
};
|
||||
|
||||
operator uint32_t() const {
|
||||
return raw;
|
||||
}
|
||||
|
||||
simd32_t& operator=(uint32_t v) {
|
||||
raw = v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
static_assert(sizeof(raw) == sizeof(vec), "simd32_t types are not the same size.");
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
simd32_t<T>* simd32_ptr(T* const p) {
|
||||
return reinterpret_cast<simd32_t<T>*>(p);
|
||||
}
|
||||
|
||||
struct vec4_s8 {
|
||||
union {
|
||||
int8_t v[4];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue