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

Fix for memory operands #584

Open
antoyo opened this issue Jan 2, 2025 · 0 comments
Open

Fix for memory operands #584

antoyo opened this issue Jan 2, 2025 · 0 comments
Labels
bug Something isn't working libgccjit requires a change in libgccjit

Comments

@antoyo
Copy link
Contributor

antoyo commented Jan 2, 2025

It seems if we were to allow setting the asm dialect, we would not need to use -masm=intel to fix the issue with memory operands in inline asm.

Notes from IRC:

what I suggest is you need to add a new field to pass all the way down for inline-asm (ASM_INPUT/ASM_OPERANDS) to specify the asm variant and have a target hook to change the syntax during processing of inline-asm
memory operands in AT&T syntax is different from Intel syntax
GCC inline-asm can be indepedent of the variant of syntax even
see https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Extended-Asm.html#Multiple-assembler-dialects-in-asm-templates
in C you can add an attribute called asm_dialect which accepts a string and that string can be compared against different strings from a target hook which returns the dialect #. this is how you can support it in the rust front-end too via a target hook
the idea is front-ends should almost know anything about targets and everything should be a target hook (or a virtual function call); don't copy clang and their front-end idea of not using target hooks

@antoyo antoyo added bug Something isn't working libgccjit requires a change in libgccjit labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libgccjit requires a change in libgccjit
Projects
None yet
Development

No branches or pull requests

1 participant