Repository navigation
Conversation
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 abc9f32 ("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. Fixes: abc9f32 ("pcm: dmix: assembly: give more freedom over the constraints") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The i386
mix_areas_*()assembly clobbers esi, edi, edx, ecx, eax and ebx. At-Osgcc also uses ebp as frame pointer, so no general purpose register is left.Since abc9f32 ("pcm: dmix: assembly: give more freedom over the constraints") the
sizeoperand is"+&rm". With AVX512BW enabled (-march=skylake-avx512,cannonlake,icelake-client,x86-64-v4, or-mavx512bw) and-Os/-Oz, gcc 15.3 and 16.2 then fail:This patch restores the
"+m"constraint used before that commit forsize, in all five functions.Found by the Buildroot autobuilders: https://autobuild.buildroot.org/results/ff613c2d94c35a38a5886b70d72aa37b58440b5d
Testing: compiled
pcm_dmix_i386.hwith gcc 15.3.0 and 16.2.0 (i686), for -O0/-O1/-O2/-O3/-Os/-Oz × 9-marchvalues × with/without-fPIC. Before: all-Os/-Oz+ AVX512BW combinations fail. After: all 108 combinations build. A full i686 Buildroot build of alsa-lib with the failing configuration passes as well.🤖 Generated with Claude Code