This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gas] new port advice


Thanks Nick, that's a great pointer ..

On Wed, 08 Apr 2015 16:31:40 +0100
Nicholas Clifton <nickc@redhat.com> wrote:

> gas/config/tc-<your arch>.c
> 
> You will probably want to update md_assemble() in that file, (or one

Unfortunately, the existing code there is not like MIPS, which has a
parse loop I could happily deal with.  Instead the arch I am looking at
calls to CGEN, which loses me in a twisty maze :(.  The md_assemble()
code does

    gas_cgen_init_parse ();
    insn.insn = XXX_or1k_cgen_assemble_insn(....);
    gas_cgen_finish_insn(insn.insn, ...)

I can see the XXX_or1k_cgen_assemble_insn in opcodes/XXX-asm.c but
it calls to yet more generic code, which presumably works off the
XXX_cgen_insn_table array that I can see in opcodes/XXX-desc.c.

The entries are opaque to me. The "addi" entry says

  /* addi $rD,$rA,$simm16 */
  {
  XXX_INSN_L_ADDI, "l-addi", "l.addi", 32, { 0, { { { load_of_flags, 0 } } } }
  }, 

I think that must be parse info. So gas_cgen_finish_insn must do the 
printout work.

Any idea how I can meddle with that? I can see the code in cgen.c, but
it's utterly opaque to me what it consults ...



Regards 

Peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]