projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20c2567
)
(no commit message)
author
lkcl
<lkcl@web>
Sat, 19 Mar 2022 06:49:11 +0000
(06:49 +0000)
committer
IkiWiki
<ikiwiki.info>
Sat, 19 Mar 2022 06:49:11 +0000
(06:49 +0000)
openpower/sv/bitmanip/gfpinv.py
patch
|
blob
|
history
diff --git
a/openpower/sv/bitmanip/gfpinv.py
b/openpower/sv/bitmanip/gfpinv.py
index e75773abd36c76fbac98bf19617010e4dec7e599..45b6dbbdd4cb19bdbfa0538fb9dfcb79981655fe 100644
(file)
--- 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: