From: Luke Kenneth Casson Leighton Date: Fri, 19 Jun 2020 20:29:30 +0000 (+0100) Subject: add comments on trunc_div and trunc_rem X-Git-Tag: div_pipeline~307 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8920df310fc7ac51a59cd7be4bb9be23bf26bd42;p=soc.git add comments on trunc_div and trunc_rem --- diff --git a/src/soc/decoder/helpers.py b/src/soc/decoder/helpers.py index ef6610e5..6b61ffca 100644 --- a/src/soc/decoder/helpers.py +++ b/src/soc/decoder/helpers.py @@ -10,6 +10,8 @@ def exts(value, bits): sign = 1 << (bits - 1) return (value & (sign - 1)) - (value & sign) + +# this is a POWER ISA 3.0B compatible div function def trunc_div(n, d): f = getattr(n, "trunc_div", None) if f is not None: @@ -24,6 +26,8 @@ def trunc_div(n, d): return abs_q return -abs_q + +# this is a POWER ISA 3.0B compatible mod / remainder function def trunc_rem(n, d): f = getattr(n, "trunc_rem", None) if f is not None: