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: [patch] MIPS Gas: generating mips16e jrc/jalrc instruction.


[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


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