From 633d57457d98b8c6ab7803fe72050f8918bba87f Mon Sep 17 00:00:00 2001 From: lkcl Date: Sat, 19 Mar 2022 06:49:11 +0000 Subject: [PATCH] --- openpower/sv/bitmanip/gfpinv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpower/sv/bitmanip/gfpinv.py b/openpower/sv/bitmanip/gfpinv.py index e75773abd..45b6dbbdd 100644 --- a/openpower/sv/bitmanip/gfpinv.py +++ b/openpower/sv/bitmanip/gfpinv.py @@ -16,12 +16,16 @@ def gfpinv(a): r = 0 s = 1 while v > 0: + # implementations could use count-zeros on + # both u and r to save cycles if u & 1 == 0: u >>= 1 if r & 1 == 0: r >>= 1 else: r = (r + p) >> 1 + # implementations could use count-zeros on + # both v and s to save cycles elif v & 1 == 0: v >>= 1 if s & 1 == 0: -- 2.30.2