This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gas] new port advice
- From: Peter Breuer <peter dot t dot breuer at gmail dot com>
- To: Nicholas Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 8 Apr 2015 21:30:50 +0100
- Subject: Re: [gas] new port advice
- Authentication-results: sourceware.org; auth=none
- References: <20150407164700 dot 4f8023ed at betty dot enbd dot org> <552549DC dot 4050805 at redhat dot com>
- Reply-to: Peter dot T dot Breuer at gmail dot com
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