Skip to content

[Xtensa] Fix .set symbolic constants in b4const/b4constu immediates#124

Open
MabezDev wants to merge 1 commit intoespressif:release/esp_21.xfrom
MabezDev:fix/xtensa-asm-set-b4const
Open

[Xtensa] Fix .set symbolic constants in b4const/b4constu immediates#124
MabezDev wants to merge 1 commit intoespressif:release/esp_21.xfrom
MabezDev:fix/xtensa-asm-set-b4const

Conversation

@MabezDev
Copy link

No description provided.

Use parseExpression() for identifier tokens in parseImmediate() instead
of manually creating MCSymbolRefExpr. This allows parsePrimaryExpr to
inline .set symbols defined as MCConstantExpr values, which is needed
for b4const/b4constu operand validation in branch instructions like
bnei, beqi, bgei, blti, bgeui, and bltui.

Without this, assembly using `.set CONST, 4` followed by
`bnei a6, CONST, label` fails with "expected b4const immediate" because
the operand is an unresolved MCSymbolRefExpr rather than an
MCConstantExpr.
@MabezDev
Copy link
Author

Resolves esp-rs/esp-hal#5110 (comment) but feel free to take this patch and implement it in a better way, if you see fit.

@MabezDev
Copy link
Author

It wasn't an issue in 20.x, so perhaps a rebase issue?

@andreisfr
Copy link
Collaborator

It wasn't an issue in 20.x, so perhaps a rebase issue?

Yes, you right, this is rebase issue, Thank you for reporting it.

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