Skip to content

Commit

Permalink
Adding fix to arm-neon bug. (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealTimeChris authored Aug 22, 2024
1 parent 0e2520e commit d6c20ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/dpp/isa/neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ namespace dpp {
inline void collect_single_register(int32_t* data_in, int16_t* data_out, float current_gain, float increment) {
neon_float gathered_values = gather_values(data_in);
neon_float gain_vector = vdupq_n_f32(current_gain);
neon_float increment_vector = vmulq_f32(vdupq_n_f32(increment), vsetq_f32(0.0f, 1.0f, 2.0f, 3.0f));
static constexpr float data[4] = { 0.0f, 1.0f, 2.0f, 3.0f };
neon_float floats = vld1q_f32(data);
neon_float increment_vector = vmulq_f32(vdupq_n_f32(increment), floats));
neon_float current_samples_new = vmulq_f32(gathered_values, vaddq_f32(gain_vector, increment_vector));

// Clamping the values between int16_t min and max
Expand Down

0 comments on commit d6c20ce

Please sign in to comment.