[libre-riscv-dev] [Bug 74] preliminary exploratory software emulation of FP SQRT

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Sun Apr 28 14:10:19 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=74

--- Comment #16 from Aleksandar Kostovic <alexandar.kostovic at gmail.com> ---
> try this:
>
>for Q in range(1, int(1e7)):
>    print(Q, sqrt(Q), sqrtsimple(Q), int(Q**0.5))
>    assert int(Q**0.5) == sqrtsimple(Q), "Q sqrtsimpl fail %d" % Q
>    assert int(Q**0.5) == sqrt(Q), "Q sqrt fail %d" % Q

Thats interesting, so as you said it may fail, it fails! Left out the
sqrtsimple and let sqrt run for a while. It worked well

>you should be able to write the function which takes e and m as arguments,
> (from comment #3) that handles the core algorithm, in about... 6 lines.
Got it. Made a function for that and pushed it. Take a look :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list