[llvm-dev] Print the Binary Form of an Instruction

Simon Cook via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 17 04:17:19 PDT 2015


Hi,

If you have an AsmParser implemented, you could put an instruction into
a file and then run it through llvm-mc with the -show-encoding option.
For example:

  llvm-mc -triple=foo -show-encoding test.s

Hope this helps.
Thanks,
Simon

On 17/08/15 09:33, Sky Flyer via llvm-dev wrote:
> Hi all,
> 
> I have defined an instruction in the InstFormat.td and InstrInfo.td
> files. I also wrote a CodeEmitter class for that, and now I have a .inc
> file after compilation that seems like it might be correct, BUT, I would
> like to see what will be generated when the assembly code is converted
> to the binary machine code!
> Is there any command in TableGen or a test class to do so?
> 
> Cheers,
> ES
> 


More information about the llvm-dev mailing list