This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] MIPS Gas: generating mips16e jrc/jalrc instruction.
- From: Richard Sandiford <richard at codesourcery dot com>
- To: David Ung <davidu at mips dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 14 Oct 2005 16:15:41 +0100
- Subject: Re: [patch] MIPS Gas: generating mips16e jrc/jalrc instruction.
- References: <1129221249.1812.280.camel@localhost.localdomain>
[Insert usual caveat about not being a maintainer ;)]
David Ung <davidu@mips.com> writes:
> portions of this object file; we could pick up the
> instruction at the destination, put it in the delay
> slot, and bump the destination address. */
> + if (mips_opts.mips16
> + && (pinfo & INSN_UNCOND_BRANCH_DELAY)
> + && (pinfo & (MIPS16_INSN_READ_X | MIPS16_INSN_READ_31))
> + && (mips_opts.isa == ISA_MIPS32
> + || mips_opts.isa == ISA_MIPS32R2
> + || mips_opts.isa == ISA_MIPS64
> + || mips_opts.isa == ISA_MIPS64R2))
> + {
> + /* convert MIPS16 jr/jalr into a "compact" jump */
> + ip->insn_opcode |= 0x0080;
> + md_number_to_chars (ip->frag->fr_literal + ip->where,
> + ip->insn_opcode, 2);
> + insert_into_history (0, 1, ip);
> + }
> + else
> + {
> insert_into_history (0, 1, ip);
> emit_nop ();
> + }
> +
The code looks good, but it orphans the emit_nop() code from the comment
that describes it. I think the comment block should be moved into the
"else" as well.
Your comment also doesn't follow FSF conventions (start with a capital
letter, end with ". ".)
IMO, this sort of thing really needs a testcase.
Richard