[Libre-soc-bugs] [Bug 325] create POWER9 TRAP pipeline

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jul 24 15:39:48 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=325

--- Comment #134 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Samuel A. Falvo II from comment #129)
> (In reply to Luke Kenneth Casson Leighton from comment #126)
> > i will commit this shortly.  do you note two things:
> > ...
> > +    start = 63 - start
> > +    end = 63 - end
> > +    # XXX must do the endian-reversing BEFORE doing the comparison
> > +    # if done after, that instead asserts that (after modification)
> > +    # start *MUST* be greater than end!
> >      if start >= end:
> >          raise ValueError(
> >              "start ({}) must be less than end ({})".format(start, end)
> >          )
> > -    start = 63 - start
> > -    end = 63 - end
> >      return slice(end, start + 1)
> 
> This is a bug.

wait.... end, start+1

ah damn, you inverted end and start, without commenting it.

that's why i didn't notice, because the expectation is that if it's called
"start" it will be first.

can you use different variable names?

msb0_end = 63 - start
msb0_start = 63 - end

followed by return slice(msb0_start, msb0_end + 1)

actually the other way round.  the *parameters* need to be called msb0_start
and msb0_end

end = 63 - msb0_start
start = 63 - msb0_end

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list