From ab6525c5037e330754fe4462db25cb36ce0cbb76 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 28 Apr 2022 02:26:09 -0700 Subject: [PATCH] add docs for clz --- src/soc/fu/div/experiment/goldschmidt_div_sqrt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py b/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py index 3801b200..ea0ddda0 100644 --- a/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py +++ b/src/soc/fu/div/experiment/goldschmidt_div_sqrt.py @@ -941,6 +941,7 @@ class GoldschmidtDivParams(GoldschmidtDivParamsBase): def clz(v, wid): + """count leading zeros -- handy for debugging.""" assert isinstance(wid, int) assert isinstance(v, int) and 0 <= v < (1 << wid) return (1 << wid).bit_length() - v.bit_length() -- 2.30.2