Please, really, make `-masm=intel` the default for x86

LIU Hao lh_mouse@126.com
Fri Nov 25 06:39:41 GMT 2022


I am a Windows developer and I have been writing x86 and amd64 assembly for more than ten years. One 
annoying thing about GCC is that, for x86 if I need to write I piece of inline assembly then I have 
to do it twice: one in AT&T syntax and one in Intel syntax.


The AT&T syntax is an awkward foreign dialect, designed originally for PDP-11 and spoken by bumpkins 
that knew little about x86 or ARM. No official Intel or AMD documentation ever adopts it. The syntax 
is terrible. Consider:

    movl $1, %eax  ; k; moves $1 into EAX
                   ; but in high-level languages we expect '%eax = $1',
                   ; so it goes awkwardly backwards.

If this looks fine to you, please re-consider:

   cmpl $1, %eax
   jg .L1          ; does this mean 'jump if $1 is greater than %eax'
                   ; or something stupidly reversed?

If CMP still looks fine to you, please consider how to write VFMADD231PD in AT&T syntax, really.


I have been tired of such inconsistency. For God's sake, please deprecate it.


-- 
Best regards,
LIU Hao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20221125/1ae0983d/attachment.sig>


More information about the Gcc mailing list