Skip to content

Commit

Permalink
suppress spurious -Waggressive-loop-optimizations warning
Browse files Browse the repository at this point in the history
Workaround for issue lieff#88
  • Loading branch information
mvduin authored and lieff committed Aug 1, 2021
1 parent a4e2585 commit ca7c706
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions minimp3.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,22 @@ static void L3_midside_stereo(float *left, int n)
int i = 0;
float *right = left + 576;
#if HAVE_SIMD
if (have_simd()) for (; i < n - 3; i += 4)
if (have_simd())
{
f4 vl = VLD(left + i);
f4 vr = VLD(right + i);
VSTORE(left + i, VADD(vl, vr));
VSTORE(right + i, VSUB(vl, vr));
for (; i < n - 3; i += 4)
{
f4 vl = VLD(left + i);
f4 vr = VLD(right + i);
VSTORE(left + i, VADD(vl, vr));
VSTORE(right + i, VSUB(vl, vr));
}
#ifdef __GNUC__
/* Workaround for spurious -Waggressive-loop-optimizations warning from gcc.
* For more info see: https://github.com/lieff/minimp3/issues/88
*/
if (__builtin_constant_p(n % 4 == 0) && n % 4 == 0)
return;
#endif
}
#endif /* HAVE_SIMD */
for (; i < n; i++)
Expand Down

0 comments on commit ca7c706

Please sign in to comment.