Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brcf, brcfnd documentation doesn't match LLVM implementation #77

Open
Emoun opened this issue Oct 15, 2020 · 3 comments
Open

brcf, brcfnd documentation doesn't match LLVM implementation #77

Emoun opened this issue Oct 15, 2020 · 3 comments

Comments

@Emoun
Copy link
Member

Emoun commented Oct 15, 2020

The handbook documentation around the brcf and brcfnd says that these instructions use the formats CFLi (immediate operand) and CFLrt (two register operands). However, for inline assembly giving them two registers will throw an error:

<inline asm>:35:16: error: invalid operand for instruction or syntax mismatch
        brcfnd  $r1,  $r10
<inline asm>:36:16: error: invalid operand for instruction or syntax mismatch
        brcf    $r12, $r12

while giving them only 1 register operand (matching CFLrs format) will compile with no issue and even be accepted by patmos-llvm-objdump as a valid instruction.

So, is the documentation wrong, or is it the implementation?
If the documentation is wrong, is the CFLrt format used by any instructions (no other instructions are in the handbook.)
If the implementation is wrong, what would the semantics of the CFLrt formats be?

@Emoun
Copy link
Member Author

Emoun commented Oct 19, 2020

@schoeberl can you look into this?

@Emoun
Copy link
Member Author

Emoun commented Nov 25, 2022

@schoeberl what is your opinion on this one? Should I just correct the handbook to fit?

@Emoun
Copy link
Member Author

Emoun commented Nov 25, 2022

Looking into the compiler's code, I can see that there is a format specified as CFLrt and used by 8 branch types:
BRCFR(ND)u, BRCFR(ND), BRCFT(ND)u, BRCFT(ND).

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

No branches or pull requests

1 participant