mirror of https://github.com/zeldaret/botw.git
Havok: Use a typedef for hkSimdFloat32 storage type
This commit is contained in:
parent
50a51e6e06
commit
5c55811abd
|
@ -13,13 +13,19 @@ using hkSimdFloat32Parameter = class hkSimdFloat32;
|
||||||
|
|
||||||
class hkSimdFloat32 {
|
class hkSimdFloat32 {
|
||||||
public:
|
public:
|
||||||
|
#ifdef HK_SIMD_FLOAT32_AARCH64_NEON
|
||||||
|
using Storage = __attribute__((vector_size(2 * sizeof(float)))) float;
|
||||||
|
#else
|
||||||
|
using Storage = float;
|
||||||
|
#endif
|
||||||
|
|
||||||
hkSimdFloat32() = default;
|
hkSimdFloat32() = default;
|
||||||
|
|
||||||
#ifdef HK_SIMD_FLOAT32_AARCH64_NEON
|
#ifdef HK_SIMD_FLOAT32_AARCH64_NEON
|
||||||
// NOLINTNEXTLINE(google-explicit-constructor)
|
// NOLINTNEXTLINE(google-explicit-constructor)
|
||||||
hkSimdFloat32(const float& x) { m_real = vdup_n_f32(x); }
|
hkSimdFloat32(const float& x) { m_real = vdup_n_f32(x); }
|
||||||
// NOLINTNEXTLINE(google-explicit-constructor)
|
// NOLINTNEXTLINE(google-explicit-constructor)
|
||||||
hkSimdFloat32(__attribute__((vector_size(2 * sizeof(float)))) float x) { m_real = x; }
|
hkSimdFloat32(const Storage& x) { m_real = x; }
|
||||||
hkFloat32 val() const { return m_real[0]; }
|
hkFloat32 val() const { return m_real[0]; }
|
||||||
#else
|
#else
|
||||||
hkSimdFloat32(float x) : m_real{x} {} // NOLINT(google-explicit-constructor)
|
hkSimdFloat32(float x) : m_real{x} {} // NOLINT(google-explicit-constructor)
|
||||||
|
@ -33,11 +39,7 @@ public:
|
||||||
|
|
||||||
void setAbs(hkSimdFloat32Parameter x);
|
void setAbs(hkSimdFloat32Parameter x);
|
||||||
|
|
||||||
#ifdef HK_SIMD_FLOAT32_AARCH64_NEON
|
Storage m_real;
|
||||||
__attribute__((vector_size(2 * sizeof(float)))) float m_real;
|
|
||||||
#else
|
|
||||||
hkFloat32 m_real;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int Constant>
|
template <int Constant>
|
||||||
|
|
Loading…
Reference in New Issue