-
Notifications
You must be signed in to change notification settings - Fork 171
WASM_X86: Use alphabets and underscore for label names #1329
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
Conversation
Because, special characters like '-' are leading to assembler errors with the generated x86 textual representation Also, 1. Rename loc_to_str to label_to_str and use string as key instead of int 2. Use map instead of unordered_map, because its worst case complexity is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine, but using strings is slower than using integers. What errors were you getting? I think we should rather fix the assembler if there are issues there, so that we can keep the compilation high performing.
Sorry, by assembler, I mean
Example: def main0():
x: i32
x = (2+3)*5
print(x)
main0() x86 text format generated (filename: tmp.asm)BITS 32ehdr: ehdrsize equ 0x00000034 phdr: phdrsize equ 0x00000020 e_phoff equ 0x00000034 print_i32: e_entry equ 0x08048125 filesize equ 0x00000141 Compiling with $ nasm -f bin tmp.asm
tmp.asm:61: error: expression syntax error
tmp.asm:94: error: parser: instruction expected
tmp.asm:137: error: label `string' inconsistently redefined
tmp.asm:94: note: label `string' originally defined here
tmp.asm:137: error: parser: instruction expected Note: lpython/src/libasr/codegen/wasm_to_x86.cpp Lines 414 to 415 in 1aeff83
To generate the |
Got it. I shared about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine to merge.
Because, special characters like '-' are leading to assembler errors with the generated x86 textual representation
Also,