[PATCH v1] Add Loongson2F specific NOP instruction

Wu Zhangjin wuzhangjin@gmail.com
Sun Nov 15 08:04:00 GMT 2009


Hi, Richard

Thanks very much for your feedback, what about this one?

Herein, I use "addu at,at,zero"(move at,at) as a work around, have
tested it with gcc 4.5 on the linux kernel 2.6.32-rc7.

Best Regards,
	Wu Zhangjin

On Sat, 2009-11-14 at 12:47 +0000, Richard Sandiford wrote:
> Wu Zhangjin <wuzhangjin@gmail.com> writes:
> > I'm sorry, "addu v0,zero,v0" may make kernel hang at "ld      a0,0(v0)",
> > I need to change it be something else.
> 
> Also, workarounds like this should generally be under the control
> of an -mfix-* option, so that you can get them even when compiling
> without -march=loongson*.  For example, a distributor might want
> to compile code that runs on both Loongson and non-Loongson
> architectures while still avoiding this errata.  (This is how
> errata on other MIPS processors are handled.)
> 
> Of course, the likelihood of a distributor doing this depends on whether
> the errata only affects kernel code.  But then there are two cases:
> 
>   - if the errata can only happen in the kernel, we might want
>     to compile userspace normally, since I imagine using non-zero
>     registers would introduce false pipeline hazards.  -mfix-* would
>     be useful to distinguish between kernel and userspace code.
> 
>   - if the errata can happen in userspace, -mfix-* would be useful
>     to distributors.
> 
> It's OK for -march=loongson* to imply -mfix-*, if that seems appropriate.
> -march=loongson* musn't trump an explicit -mno-fix-* though.
> 
> Any patch along those lines will need a copyright assignment.  Do you
> (or your employer) have one on file?
> 
> Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Work-around-the-NOP-issue-of-Loongson2F.patch
Type: text/x-patch
Size: 4352 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20091115/835bfd60/attachment.bin>


More information about the Binutils mailing list