public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Please, really, make `-masm=intel` the default for x86
@ 2022-11-25  7:48 Dave Blanchard
  2022-11-25  8:03 ` LIU Hao
  0 siblings, 1 reply; 13+ messages in thread
From: Dave Blanchard @ 2022-11-25  7:48 UTC (permalink / raw)
  To: gcc


On Fri, 25 Nov 2022 at 09:40, LIU Hao via Gcc <gcc@gcc.gnu.org> wrote:
>> 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.

> Why? A default is merely a default. I don't really see why changing
> that should help you specifically. A decision "which assembly syntax
> to use" is one that makes a project like ones you're contributing to,
> not GCC. If they decided to use AT&T syntax, they won't switch to
> Intel just because a compiler toolchain has changed their default.

While I sympathize with the desire to get rid of crud (and I agree that AT&T syntax is crud), as stated above it wouldn't really make a practical difference. For distro maintainers it would likely break some/many older packages which assumed the old default behavior, thus requiring a number of patches. Usually not a big deal in and of itself (though it can be if the build system for that package is particularly junky), but when you consider there are so many packages including GCC always deprecating and changing things, it adds up to a lot of work to keep up with it all.

-- 
Dave Blanchard <dave@killthe.net>

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Please, really, make `-masm=intel` the default for x86
@ 2022-11-25  6:39 LIU Hao
  2022-11-25  7:37 ` Hi-Angel
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: LIU Hao @ 2022-11-25  6:39 UTC (permalink / raw)
  To: gcc


[-- Attachment #1.1: Type: text/plain, Size: 1083 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-11-25 13:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25  7:48 Please, really, make `-masm=intel` the default for x86 Dave Blanchard
2022-11-25  8:03 ` LIU Hao
  -- strict thread matches above, loose matches on Subject: below --
2022-11-25  6:39 LIU Hao
2022-11-25  7:37 ` Hi-Angel
2022-11-25  7:56   ` LIU Hao
2022-11-25  8:50 ` Marc Glisse
2022-11-25  9:11   ` LIU Hao
2022-11-25  9:30     ` Jonathan Wakely
2022-11-25  9:56     ` Iain Sandoe
2022-11-25  9:32 ` Jakub Jelinek
2022-11-25 12:01   ` LIU Hao
2022-11-25 13:00     ` Richard Biener
2022-11-25 13:31 ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).