add comments on trunc_div and trunc_rem
[soc.git] / src / soc / decoder / helpers.py
index ef6610e5c89d7d0e0316c216bf51faf8486f46df..6b61ffcaec651fa5fe0db3ab575e7920a75de9c4 100644 (file)
@@ -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: