Rework MIPS nop-insertion code, add -mfix-vr4130 [6/11]

Richard Sandiford rsandifo@redhat.com
Tue Mar 8 15:00:00 GMT 2005


After the previous patch, the branch delay-slot code no longer needs
to check whether we've inserted any nops before the branch.  If we did
insert some nops, they will already be in the history buffer, and will
already be marked as fixed.

It's also not necessary to check whether the previous instruction was
a delayed branch.  If such a branch occurs outside a noreorder block,
we will always emit a delay slot for it, so we'll never see the
branch in history[0].  If a branch occurs _inside_ a noreorder block,
we wouldn't use it for that very reason.

Tested on mips64{,el}-linux-gnu and mipsisa64{,el}-elf.  OK to install?

Richard



	* config/tc-mips.c (append_insn): Remove now-redundant nops != 0
	check from branch delay code.  Remove unnecessary check for branches.

diff -crpN gas.6/config/tc-mips.c gas/config/tc-mips.c
*** gas.6/config/tc-mips.c	2005-03-08 10:30:43.161925269 +0000
--- gas/config/tc-mips.c	2005-03-08 10:40:48.973789602 +0000
*************** append_insn (struct mips_cl_insn *ip, ex
*** 2472,2480 ****
  	      /* If we have seen .set volatile or .set nomove, don't
  		 optimize.  */
  	      || mips_opts.nomove != 0
- 	      /* If we had to emit any NOP instructions, then we
- 		 already know we can not swap.  */
- 	      || nops != 0
  	      /* We can't swap if the previous instruction's position
  		 is fixed.  */
  	      || history[0].fixed_p
--- 2472,2477 ----
*************** append_insn (struct mips_cl_insn *ip, ex
*** 2536,2546 ****
                    /* Itbl support may require additional care here.  */
  		  && (prev_pinfo & INSN_COPROC_MEMORY_DELAY)
  		  && ! cop_mem_interlocks)
- 	      /* We can not swap with a branch instruction.  */
- 	      || (prev_pinfo
- 		  & (INSN_UNCOND_BRANCH_DELAY
- 		     | INSN_COND_BRANCH_DELAY
- 		     | INSN_COND_BRANCH_LIKELY))
  	      /* We do not swap with a trap instruction, since it
  		 complicates trap handlers to have the trap
  		 instruction be in a delay slot.  */
--- 2533,2538 ----



More information about the Binutils mailing list