[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 18:09:03 BST 2019
http://bugs.libre-riscv.org/show_bug.cgi?id=74
--- Comment #24 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Aleksandar Kostovic from comment #18)
> > great. so... bye bye sqrt for now. can always track that down later.
> I think you misunderstood. Its the sqrtsimple function that is failing:
>
> File "/home/aleksandar/projects/ieee754fpu/src/add/fsqrt.py", line 88, in
> <module>
> assert int(Q**0.5) == sqrtsimple(Q), "Q sqrtsimpl fail %d" % Q
>
> So we use the regular sqrt func.
>
> >so, next stage, you want to write a test for-loop around the main() function?
> Will try to do it now
looks great, works well.
> >btw do you already have sfpy installed and built? if so, we can move
> >to the next phase of "from sfpy import Float32" and use that to mangle/de-mangle >FP numbers into sign/mantissa/exponent, using sfpy.Float32.get_bits
> Yes i have it installed
ok great,
so next phase will be to use "from sfpy import Float32" and create some
arbitrary numbers, say... oh i dunno, pick one! 753.415926535897932
x = Float32(fred_the_number)
xbits = x.bits
then use the function decode_fp32(xbits) to get the s, m, e
and from there you can throw those into the function main() and see what
happens.
theeeeennn... you can do sq_test = x.sqrt() above... and on the answer,
use the function decodefp32(sq_test)...
and print those out next to the answer from using main().
if those are even remotely close we have a winner!
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-riscv-dev
mailing list