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

Global labels do not seem to resolve out-of-order (inside asm{} block) #111

Closed
Emmett81 opened this issue Sep 29, 2021 · 0 comments
Closed
Labels

Comments

@Emmett81
Copy link
Contributor

Hi, when I try to run the code below I get an "instruction size did not converge after iterations" error.

Placing the T and Z parts above the #ruledef makes it work. I tried working around it by renaming Z & T to ZZ & TT and placing Z=ZZ & T=TT above the #ruledef block. But then it'll throw a "unknown variable" error. That also happens without the #ruledef block.

Am I doing something wrong?

#ruledef 
{
    sub.neg {a: u32} {b: u32} {r: u32} {j: u32} => a`32 @ b`32 @ r`32 @ j`32

    jmp {j: u32} => asm { sub.neg Z Z+1 T j }
}

jmp main

T: 
#d32 0

Z:
#d32 0 
#d32 1

main:
@hlorenzi hlorenzi added the bug label Sep 29, 2021
Artentus added a commit to Artentus/customasm that referenced this issue Oct 4, 2021
fix hlorenzi#111: keep track of instruction size guesses from previous iterat…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants