[LLVMdev] Intel vs. AT&T Assembly.

Chris Lattner sabre at nondot.org
Sun Apr 30 22:22:21 PDT 2006

On Sun, 30 Apr 2006, Jeff Cohen wrote:

Jeff, many appologies.  I slightly misread what you wrote, and came 
across more strongly that was appropriate: I'm sorry! :( :(

> Let's see.  Ralph correctly points out that LLVM isn't producing anything 
> like Intel syntax.   ...

This is not true.  LLVM produces something very close to what GAS accepts 
in intel mode: that is, we produce fully intel syntax (e.g. "DWORD PTR", 
no opcode size suffixes, etc)  but we prepend % onto registers.  This is 
what GAS expects (i.e., it's gas intel mode).  I believe there is a GAS 
option to turn off the % prefix, but we never used it because it had other 

> No, %reg is not Intel syntax, no matter what gas thinks.

There are several dialects of "intel mode", and GAS's is just one. 
Greater variation is due to differences in pseudo ops.

> Last June, Aaron Gray offered to fix Intel mode so that it actually produced 
> Intel syntax.  He offered was a gigantic cut and paste: 
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050627/026872.html. 
> Then he apparently lost interest, though he now claims he had finished it 
> after all but simply neglected to give us a patch.

Yup, that's true.  Note, however, that that patch just moved around 
existing functionality, it didn't change or add anything (hence the use of 
the term "refactor").

Specifically, when I said "Actually, that's not true.", what I meant is 
that this:

"Someone offered to do the Intel version, but did little more
than a huge cut and paste of the AT&T version and then lost interest."

... is not true.  The current Intel version is based on our original 
support for GAS Intel mode, it is not based on AT&T syntax support at all 
(which, again, came after gas intel syntax support).

As was independently pointed out, we're quite close to supporting MASM (or 
whatever) intel syntax.  Removing the %'s, for example, is trivial. 
Anyone who wants to do so is welcome to.  The current 
-x86-asm-syntax=intel support is not currently compatible with any 
assembler that I know of.  Patches to make it useful are welcome.



More information about the llvm-dev mailing list