On Fri, Mar 23, 2012 at 07:41:05AM -0500, Matthew Hicks wrote:
> You should use l.movhi to clear registers as it is a better practice than
> using an uninitialized register to clear itself.
> 

IMO there are some pros and cons with both practices,
the name of the l.movhi instruction implies that the implies
that the immediate is only moved to the upper halfword
(and iirc, there is nothing in the arch spec to demand that
the lower halfword is cleared)
So in that regard the l.andi is a much clearer choice.

The con with l.andi is that it is using r0 as a source register,
but that should not be a problem since 'x'&0 = 0 (as discussed before)

I think the conclusion is that both are fine and it is up to the writer
to choose which one to use.

Stefan

> 
> On Thu, Mar 22, 2012 at 12:12 PM, R. Diez <[email protected]>wrote:
> 
> > Hallo Jeremy:
> >
> > Further to my previous e-mails, please find attached a patch to clear R0
> > on start-up in all or1ksim's test cases under test-code-or1k.
> >
> > Regards,
> >  Ruben
> >
> > _______________________________________________
> > OpenRISC mailing list
> > [email protected]
> > http://lists.openrisc.net/listinfo/openrisc
> >
> >

> _______________________________________________
> OpenRISC mailing list
> [email protected]
> http://lists.openrisc.net/listinfo/openrisc

_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to