[Libre-soc-bugs] [Bug 324] create POWER9 DIV pipeline

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jun 19 15:00:40 BST 2020


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

--- Comment #16 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #13)
> The spec pseudo-code doesn't contain all the required information to
> implement any of the div or mod operations since only the prose states the
> conditions for overflow (which *DO* show up in the overflow flags when div*o
> is used).

answered this one.

> All divisions are truncating division, not floor division, so we should
> translate them to function calls to custom trunc_div and trunc_rem functions
> rather than python's // and % operators (since the mod* instructions
> implement the mathematical remainder of truncating division operation rather
> than the mathematical modulo operation).

urk. yuk.  that's going to be a bad hack (based on the name of the variables
involved - what is being assigned to).  it's doable - just not pretty.

> Code not tested:
> 
> def trunc_div(n, d):
> def trunc_rem(n, d):

ok i've put both of these into soc.decoder.helpers will commit shortly.

btw a trick, jacob: open a copy of decoder/isa/all.py in vim, run
"pywriter.py fixedarith" then *overwrite* all.py restoring the former
version.

this will save several minutes when re-running pywriter.py.  it would be
nice for this process to be more efficient (all.py not to be statically
written but to be dynamic instead).

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


More information about the libre-soc-bugs mailing list