Question about inline assembly in LDC

Cecil Ward cecil at cecilward.com
Mon Aug 21 23:18:50 UTC 2023


On Monday, 21 August 2023 at 16:38:29 UTC, kinke wrote:
> LDC doesn't support the Intel syntax in GDC-style inline asm, 
> AT&T only. [We'd have to tell LLVM that an *entire* GDC-style 
> inline asm statement is in Intel syntax.]
>
> The Intel syntax is only supported in DMD-style inline asm.

Does that mean that in principle LDC could understand intel-style 
syntax but only if it knew in advance which type of syntax was 
being used in the _whole_ thing, ie as opposed to being told too 
late by a .intel_syntax directive? To get interoperability 
between GDC and LDC then perhaps the two compilers could have an 
external ‘dialect’ parameter that is available before we get into 
the statements-body. Failing that, LDC would need to look ahead 
for the likes of a .intel_syntax directive with an auto 
detect-type initial regex. Seeing as presumably no one ever 
switches dialects other than at the start, then that would 
certainly work well. I’m very good at proposing work for others. 
:-)



More information about the digitalmars-d-ldc mailing list