pcm: dmix: i386: keep the size operand in memory
The i386 mix_areas_*() assembly clobbers esi, edi, edx, ecx, eax and
(since gcc 5, even in PIC mode) ebx. When gcc also needs ebp as frame
pointer, which it does at -Os, no general purpose register is left.
Commit
abc9f32cf45c ("pcm: dmix: assembly: give more freedom over the
constraints") relaxed the size operand from "+m" to "+&rm". With
AVX512BW enabled (e.g. -march=skylake-avx512, cannonlake, icelake or
x86-64-v4) and -Os or -Oz, gcc 15 and gcc 16 then fail to pick the
memory alternative and abort:
pcm_dmix_i386.h:52:9: error: 'asm' operand has impossible constraints or there are not enough registers
As the asm already uses all registers, restore the "+m" constraint for
size, as used before that commit. The loop decrementing it in memory
also does read-modify-write operations on dst and sum, so the extra
memory access has a negligible cost.
Closes: https://github.com/alsa-project/alsa-lib/pull/537
Fixes: abc9f32cf45c ("pcm: dmix: assembly: give more freedom over the constraints")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>