[llvm-dev] [SPARC]: leon2 and leon3: not respecting delayed-write to Y-register

Patrick Boettcher via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 16 07:11:51 PST 2016


On Wed, 16 Nov 2016 10:01:44 -0500
James Y Knight <jyknight at google.com> wrote:

> On Wed, Nov 16, 2016 at 5:29 AM, Patrick Boettcher via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
> 
> > Hi,
> >
> > in section B.29. (Write State Register Instructions) of 'The SPARC
> > Architecture Manual Version 8' it is said that the "The write state
> > register instructions are delayed-write instructions."
> >
> > The Y-register is a state-register.
> >
> > Furthermore in the B.29-secion there is a programming note saying:
> >
> >   MULScc, RDY, SDIV, SDIVcc, UDIV, and UDIVcc implicitly read the Y
> >   register. If any of these instructions execute within three
> >   instructions after a WRY which changed the contents of the Y
> >   register, its results are undefined.
> >
> > This currently is not respected with LLVM. I'm using 3.9 and checked
> > whether any commit on the master-branch handles this case, I haven't
> > seen anything - but I might be wrong.
> >  
> 
> Yep, this definitely isn't done. However, it appears that on the
> hardware I've looked at, it didn't appear to actually be necessary
> (as one might expect from sane hardware...), so I'd not gotten around
> to fixing it.
> 
> Are you looking at this because you have a program which is
> mis-executing on some hardware you have, or just because you were
> looking at the assembly output and noticed the spec non-compliance?

Yes, my hardware (Leon2, a SparcV8) is (unfortunately)
standard-compliant and has this problem. 

--
Patrick.


More information about the llvm-dev mailing list