Skip to content

Commit ea9b86c

Browse files
committed
dr: import upstream change to silence a spurious warning
1 parent 5772689 commit ea9b86c

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

deps/dr/dr_mp3.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,12 +1064,22 @@ static void drmp3_L3_midside_stereo(float *left, int n)
10641064
int i = 0;
10651065
float *right = left + 576;
10661066
#if DRMP3_HAVE_SIMD
1067-
if (drmp3_have_simd()) for (; i < n - 3; i += 4)
1067+
if (drmp3_have_simd())
10681068
{
1069-
drmp3_f4 vl = DRMP3_VLD(left + i);
1070-
drmp3_f4 vr = DRMP3_VLD(right + i);
1071-
DRMP3_VSTORE(left + i, DRMP3_VADD(vl, vr));
1072-
DRMP3_VSTORE(right + i, DRMP3_VSUB(vl, vr));
1069+
for (; i < n - 3; i += 4)
1070+
{
1071+
drmp3_f4 vl = DRMP3_VLD(left + i);
1072+
drmp3_f4 vr = DRMP3_VLD(right + i);
1073+
DRMP3_VSTORE(left + i, DRMP3_VADD(vl, vr));
1074+
DRMP3_VSTORE(right + i, DRMP3_VSUB(vl, vr));
1075+
}
1076+
#ifdef __GNUC__
1077+
/* Workaround for spurious -Waggressive-loop-optimizations warning from gcc.
1078+
* For more info see: https://github.com/lieff/minimp3/issues/88
1079+
*/
1080+
if (__builtin_constant_p(n % 4 == 0) && n % 4 == 0)
1081+
return;
1082+
#endif
10731083
}
10741084
#endif
10751085
for (; i < n; i++)

0 commit comments

Comments
 (0)