[LLVMdev] X86AsmPrinter + MASM and NASM backends

Chris Lattner sabre at nondot.org
Mon Jul 11 16:35:40 PDT 2005


On Tue, 12 Jul 2005, Aaron Gray wrote:
>>>> You shouldn't have to add new classes to the .td file, just modify 
>>>> printOp for your asmprinters.
>>> I dont think printOp is virtual and therefore cannot be overriden ?
>> Why does it need to be virtual?  No 'intel' printers want % signs.
>
> The GAS intel code generator generates percents, look at the X86InstrInfo.td 
> file it is full of them.

Ah, I see what you're talking about.  Please feel free to remove all of 
those from the Intel format.  For example, change this:

def IN8rr  : I<0xEC, RawFrm, (ops),
                "in{b} {%dx, %al|%AL, %DX}">,  Imp<[DX], [AL]>;

to:

def IN8rr  : I<0xEC, RawFrm, (ops),
                "in{b} {%dx, %al|AL, DX}">,  Imp<[DX], [AL]>;

For register allocatable values, changing printOp in the 
X86IntelAsmPrinter should do the job.

> The X86IntelAsmPrinter is not overridable and inheritable for this job. The 
> X86MASMPrinter overrides too much for the Intel one to be useful.

Again, there is *nothing* currently using the 'intel' asm printer.  Feel 
free to change it however you find convenient... such as the above items.

Also, when you do things like this, please send patches.  Also, patches 
should generally be sent to the llvmbugs list (which is designed for bugs 
and patches), not llvmdev.  In response to your recent 'MASM Backend' 
mail, please update it per the feedback I gave for the 'isWindows' flag 
email, and resent to llvmbugs.

Thanks!

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list