Skip to content

Commit

Permalink
Fix the ARM Neon build
Browse files Browse the repository at this point in the history
  • Loading branch information
crsib committed Oct 2, 2023
1 parent 60c3f81 commit ac948b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libraries/lib-time-and-pitch/StaffPad/SimdTypes_neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define __vecc
#endif

#include <cmath>

namespace staffpad::audio::simd {

struct float_x4
Expand Down Expand Up @@ -141,6 +143,11 @@ __finl float_x4 __vecc sqrt(const float_x4 &a)
return vsqrtq_f32(a.s);
}

__finl float __vecc rint(float a)
{
return std::rint(a);
}

__finl float_x4 __vecc rint(const float_x4 &a)
{
return vrndnq_f32(a.s);
Expand Down
5 changes: 5 additions & 0 deletions libraries/lib-time-and-pitch/StaffPad/SimdTypes_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ __finl float_x4 __vecc sqrt(const float_x4 &a)
return {std::sqrt(a[0]), std::sqrt(a[1]), std::sqrt(a[2]), std::sqrt(a[3])};
}

__finl float __vecc rint(float a)
{
return std::rint(a);
}

__finl float_x4 __vecc rint(const float_x4 &a)
{
return {std::rint(a[0]), std::rint(a[1]), std::rint(a[2]), std::rint(a[3])};
Expand Down

0 comments on commit ac948b5

Please sign in to comment.