projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edbdd29
)
add comments on trunc_div and trunc_rem
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Fri, 19 Jun 2020 20:29:30 +0000
(21:29 +0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Fri, 19 Jun 2020 20:29:30 +0000
(21:29 +0100)
src/soc/decoder/helpers.py
patch
|
blob
|
history
diff --git
a/src/soc/decoder/helpers.py
b/src/soc/decoder/helpers.py
index ef6610e5c89d7d0e0316c216bf51faf8486f46df..6b61ffcaec651fa5fe0db3ab575e7920a75de9c4 100644
(file)
--- 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: