>On Mon, Jun 15, 2009 at 5:49 PM, Gaster, >Benedict<Benedict.Gaster at amd.com> wrote: >> I would like to use the LLVM x86 code generator to emit Intel syntax that >> is >> compatible with Microsoft’s MASM 9.x. Taking the TOT LLVM, from last >> week, I >> have found a number of changes that are required to make this work, most >> of >> which are straight forward but a couple I wanted to check with the group >> to >> see what people thought was the best thing to do. In particular, I have >> made >> all necessary changes and these are mostly constrained to the files: >> >> X86IntelAsmPrinter.[h|cpp] >> >> X86TargetAsmInfo.[h|cpp] > >Sounds good; did you mean to attach a patch? It'll be easier to >discuss with that. (The output of "svn diff" is fine.)Appently the GAS Intel backend has flaws and does not work correctly anyway so the X86IntelAsm backend is designed only to target MASM anyway. Aaron
On Tuesday 16 June 2009 09:48, Aaron Gray wrote:> Appently the GAS Intel backend has flaws and does not work correctly anyway > so the X86IntelAsm backend is designed only to target MASM anyway.gas Intel syntax is indeed broken in LLVM. I'd love to make it work but my work has not (yet) allocated time for that. Maybe I can hack LLVM on the weekends. :) The above discussion leads me to believe there are fundamental conflicts between MASM and gas syntax. Is NASM any better than MASM? I would hate for MASM to impose draconian restrictions on the Intel asm printer for all targets. Do we need a third asm printer? -Dave
On Jun 16, 2009, at 3:12 PM, David Greene wrote:> On Tuesday 16 June 2009 09:48, Aaron Gray wrote: > >> Appently the GAS Intel backend has flaws and does not work >> correctly anyway >> so the X86IntelAsm backend is designed only to target MASM anyway. > > gas Intel syntax is indeed broken in LLVM. I'd love to make it work > but > my work has not (yet) allocated time for that. Maybe I can hack > LLVM on > the weekends. :) > > The above discussion leads me to believe there are fundamental > conflicts > between MASM and gas syntax. > > Is NASM any better than MASM? > > I would hate for MASM to impose draconian restrictions on the Intel > asm > printer for all targets.Personally, I'd rather just bring up a PE COFF writer and use the masm backend for "debugging". -Chris
> On Tuesday 16 June 2009 09:48, Aaron Gray wrote: > >> Appently the GAS Intel backend has flaws and does not work correctly >> anyway >> so the X86IntelAsm backend is designed only to target MASM anyway. > > gas Intel syntax is indeed broken in LLVM. I'd love to make it work but > my work has not (yet) allocated time for that. Maybe I can hack LLVM on > the weekends. :)I think writing an assembler using LLVM Table gen and data, and using the DOCE (Direct Object Code Emission) backends (see LLVM Wiki for details) when they are ready is a much better solution. I am planning on doing a full tool set (linker, and librarian anyway) to replace binutils for LLVM on Windows, and maybe for other bianry formats. Although this will take time, hopefully we will get more people working on it when there is something basic running as a proof of concept.> The above discussion leads me to believe there are fundamental conflicts > between MASM and gas syntax. > > Is NASM any better than MASM?Probably if MASM does not support aligns or weak symbols properly.> I would hate for MASM to impose draconian restrictions on the Intel asm > printer for all targets.Yes.> Do we need a third asm printer?I think so. Aaron