[libre-riscv-dev] [Bug 127] Transcendentals needed (SIN/COS/ATAN2/EXP/LOG/POW etc.)
bugzilla-daemon at libre-riscv.org
bugzilla-daemon at libre-riscv.org
Mon Aug 5 09:20:59 BST 2019
http://bugs.libre-riscv.org/show_bug.cgi?id=127
--- Comment #2 from Jacob Lifshay <programmerjake at gmail.com> ---
I think that having sinpi, cospi, and tanpi in the base extension is better,
since they are much simpler to implement. sin, cos, and tan require a very
precise value of pi for converting the argument into the range [0,2*pi) and
maintaining accuracy, hence why I had proposed putting them in the non-*pi trig
extension. For consistency, all the rest of the *pi functions are in the base
extension and the non-*pi are not in the base extension.
The above is how I had (apparently non-obviously) had the instructions grouped
into extensions in
http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-August/002290.html
assuming I calculated properly, the precision required for pi for sin is over
1000 bits for f64, since the max value of f64 is slightly less than 2^1024 and
we want the remainder to still have more than 53 bits of accuracy for proper
rounding. f32 requires somewhere around 150 bits of pi.
This is the opposite of how they are assigned in the current Ztrans draft.
Jacob
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-riscv-dev
mailing list