>>> 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. The X86IntelAsmPrinter is not overridable and inheritable for this job. The X86MASMPrinter overrides too much for the Intel one to be useful. Aaron
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/
>> 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.Yes GNU AS works either with or without % symbols for its register names. So presumably we remove the percents from the intel generator and then have the X86MASMPrinter inherit from the X86IntelAsmPrinter as was originally intended.> 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.I will make these changes and create some patches. Aaron