Skip to content

cherry-pick patch to fix assembler errors#6

Open
1480c1 wants to merge 1 commit intobcoudurier:ffmbcfrom
1480c1:shr-ffmbc
Open

cherry-pick patch to fix assembler errors#6
1480c1 wants to merge 1 commit intobcoudurier:ffmbcfrom
1480c1:shr-ffmbc

Conversation

@1480c1
Copy link
Copy Markdown

@1480c1 1480c1 commented Jan 19, 2026

CC      libavformat/adtsenc.o
{standard input}: Assembler messages:
{standard input}:548: Error: operand type mismatch for `shr'
{standard input}:626: Error: operand type mismatch for `shr'
{standard input}:709: Error: operand type mismatch for `shr'

Fixes assembling with binutil as >= 2.41

…in inline assembly

Fixes assembling with binutil as >= 2.41

Signed-off-by: James Almer <jamrial@gmail.com>
Copilot AI review requested due to automatic review settings January 19, 2026 01:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes assembler errors that occur with binutils >= 2.41 by updating inline assembly constraints in x86-specific math operations. The changes distinguish between compile-time constant shift values and runtime shift values, using appropriate assembly constraints for each case.

Changes:

  • Added runtime checks using __builtin_constant_p() to differentiate between constant and variable shift amounts
  • Updated assembly constraints: using "i" constraint with mask for constants, and "c" constraint for runtime variables
  • Applied the fix to three functions: MULL, NEG_SSR32, and NEG_USR32

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants