[patch] [MIPS] Implement Errata for 24K and 24KE

Catherine Moore clm@codesourcery.com
Thu May 21 14:38:00 GMT 2009


Hi Richard,

Richard Sandiford wrote:
> Catherine Moore <clm@codesourcery.com> writes:
>> I've attached a new patch.  It adds the testcases that you asked for
>> along with the other cleanups.  I had trouble with one section -- this
>> first example:
>>
>> 	.set	noreorder
>> 1:	eret
>> 	.set	reorder
>> 	b	1b
>>
>> insns_between is called only when the the history insn is not in a
>> noreorder block.
> 
> Hmm, yeah.  So the current code doesn't behave as I said after all. ;(
> Sorry about that.  Serves me right for going on memory.
> 
> I still think that what I said is what ought to happen.  I can't see
> any reason for the current approach to non-24k hazards, where we insert
> nops between A and B iff _A_ is not in a noreorder block.  Why should
> A and B be assymetric in that way?

This sounds like a good plan.  Will you let me know when you've checked in your bit?

> So assuming we can use the patch below, and drop the hunk above
> from your patch, the rest looks good.  However, the logic is
> overly complex: 

(code snipped).  I think that you meant for the check on insn2 to be insn2 != NULL, otherwise this 
change looks okay to me as well.
Thanks!
Catherine

> 
>
> 
> Since insn1 can't be null, this reduces to:
> 
>   if (mips_fix_24k)
>     {
>       if (insn1->insn_opcode == INSN_ERET
> 	  || insn1->insn_opcode == INSN_DERET)
> 	{
> 	  if (insn2 == NULL
> 	      || insn2->insn_opcode == INSN_ERET
> 	      || insn2->insn_opcode == INSN_DERET
> 	      || (insn2->insn_mo->pinfo
> 		  & (INSN_UNCOND_BRANCH_DELAY
> 		     | INSN_COND_BRANCH_DELAY
> 		     | INSN_COND_BRANCH_LIKELY)) != 0)
> 	    return 1;
> 	}
>     }
> 
> The patch is OK to apply with those changes, assuming the patch
> below goes in first.
> 



More information about the Binutils mailing list