Skip to content

Commit

Permalink
Some small SIMD fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhancocks committed Oct 28, 2023
1 parent 3618f7e commit 867399a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/libSIMD/arm/arm_neon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace simd
SIMD_FUNCTION
static inline auto floor(f32x4 a) -> f32x4
{
return vreinterpretq_f32_s32(vreinterpretq_s32_f32(a));
return vrndmq_f32(a);
}

SIMD_FUNCTION
Expand Down
8 changes: 8 additions & 0 deletions libs/libSIMD/float32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ namespace simd
inline auto set(int i, float v) -> float32& { m_values[i] = v; return *this; }

// MARK: - Operators
inline auto operator==(const float32& other) const -> bool
{
return (m_values[0] == other.m_values[0])
&& (m_values[1] == other.m_values[1])
&& (m_values[2] == other.m_values[2])
&& (m_values[3] == other.m_values[3]);
}

inline auto operator+ (const float32& other) const -> float32 { return float32(simd::add(m_values, other.m_values)); }
inline auto operator+ (float f) const -> float32 { return float32(simd::add(m_values, simd::single_value_vector(f))); }
inline auto operator+=(const float32& other) -> float32& { m_values = simd::add(m_values, other.m_values); return *this; }
Expand Down

0 comments on commit 867399a

Please sign in to comment.