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] Add Loongson2F specific NOP instruction


On Fri, 2009-11-13 at 10:35 +0800, yanhua wrote:
> The correct patch should change nop instructions as
> 
> addu v0, v0, zero
> 
> or another likely instructions
> 
> in a short way, there must be a write to non-zero registers.
> 

Okay, I will send a new patch with it.

Thanks!
	Wu Zhangjin

> Wu Zhangjin åé:
> > This is a patch to work around a possible cpu pipeline issue. Without this,
> > under extreme cases, cpu might deadlock.(e.g. some have seen this with binutils
> > 2.18, ld dies when compiling)
> >
> > The changed instruction has no real effect since it write to the 'zero'
> > register, but it read non-zero register which is the key to prevent issue. The
> > issue has been solved in latest processor batches.
> >
> > 2009-11-13  Wu Zhangjin  <wuzhangjin@gmail.com>
> >
> >         * mips-opc.c (mips_builtin_opcodes): Add NOP instruction for
> >         Lemote Loongson 2F.
> >
> > diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
> > index caeef72..8fab6ba 100644
> > --- a/opcodes/mips-opc.c
> > +++ b/opcodes/mips-opc.c
> > @@ -187,6 +187,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
> >  /* name,    args,	match,	    mask,	pinfo,          	pinfo2,		membership */
> >  {"pref",    "k,o(b)",   0xcc000000, 0xfc000000, RD_b,           	0,		I4_32|G3	},
> >  {"prefx",   "h,t(b)",	0x4c00000f, 0xfc0007ff, RD_b|RD_t|FP_S,		0,		I4_33	},
> > +{"nop",     "",         0x00020021, 0xffffffff, 0,              	INSN2_ALIAS,	IL2F    }, /* addu zero,zero,v0 */
> >  {"nop",     "",         0x00000000, 0xffffffff, 0,              	INSN2_ALIAS,	I1      }, /* sll */
> >  {"ssnop",   "",         0x00000040, 0xffffffff, 0,              	INSN2_ALIAS,	I32|N55	}, /* sll */
> >  {"ehb",     "",         0x000000c0, 0xffffffff, 0,              	INSN2_ALIAS,	I33	}, /* sll */
> >
> >   
> 
> 



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