[llvm] r200051 - [Mips] TargetStreamer ELF flag Support for default and commandline options.

Rafael Espíndola rafael.espindola at gmail.com
Mon Jan 27 13:58:58 PST 2014


> Just to clarify part of that objective. Should the assembly file be completely self-contained, or are command line arguments permitted to carry the initial state?

They have to be. The assembly files we use are the same that gas uses.
So for example, for mips the abi is passed via a command line. The
llvm-mc command line interface is *not* compatible, so there is some
mapping involved. For example, -mips64 becomes -mcpu=mips64.

> The reason I ask is that I'm not 100% certain that the former is currently possible in all cases. For example, I'm fairly certain there is no directive equivalent to -mmsa in gas, although in this particular case we should definitely add one if it doesn’t already exist.

If it is passed to gas via a command line, it should probably be
passed to llvm-mc via a command line too. If it is printed to the .s,
it is a method in the streamer (or target streamer) interface.

> In my opinion, some (but by no means all) of it has its roots in our lack of need for an assembler other than gas. This is likely why we've been rather slow to implement the real directives and have continued to use the hack directive. That situation is changing. We have a couple projects lined up that will need a non-GPL assembler. We are in the very early stages of deciding exactly what features we need in this assembler, when, and how to achieve some of the trickier bits. It's naturally tempting to say that it should support all existing MIPS assembly but some historical behaviour of the assembler like instruction reordering (.setreorder) and the reserved scratch register (.setat) makes this harder than it sounds.

Please note that from the MC point of view, all that you need to be
able to parse are the directives that the mips codegen produces. You
don't even need to be able to parse any real instructions (nop will
do).

Cheers,
Rafael




More information about the llvm-commits mailing list