Skip to content

Fix for memory operands #584

Open
Open
@antoyo

Description

@antoyo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglibgccjitrequires a change in libgccjit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions