You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've looked into this and unfortunately it seems a difficult one: the LoongArch expressions are evaluated with custom rules defined in gas/config/loongarch-parse.y, and >> is explicitly defined to arithmetically right shift. I tried to stick a plain my_getExpression inside loongarch_parse_expr's constant-value-result branch but it breaks a number of test cases; I'm not sure if any code in the wild is depending on the previous behavior, in which case this might be impossible to fix without breakage.
However, given LLVM has the intended behavior (hence users may already have to face behavioral differences), we may be able to break compatibility a little bit here in favor of doing things right. Opinions, folks?
But it's implementation-defined unspecified whether C operator '>>' should do signed extension or zero extension for signed integer types. Maybe we should add a new switch to control the behavior?
Minimized reproducer:
This is typical code pattern expanded from Linux's
GENMASK(h, l)
macro generating bitfield constants.This breaks with current binutils-gdb main branch:
While the LLVM integrated assembler works:
The text was updated successfully, but these errors were encountered: