[libre-riscv-dev] [isa-dev] Re: FP transcendentals (trigonometry, root/exp/log) proposal

Mitchalsup mitchalsup at aol.com
Thu Jan 16 18:01:42 GMT 2020



Mitch AlsupMitchAlsup at aol.com

-----Original Message-----
From: Luke Kenneth Casson Leighton <lkcl at lkcl.net>
To: Libre-RISCV General Development <libre-riscv-dev at lists.libre-riscv.org>
Cc: MitchAlsup <mitchalsup at aol.com>
Sent: Thu, Jan 16, 2020 3:22 am
Subject: Re: [isa-dev] Re: FP transcendentals (trigonometry, root/exp/log) proposal

On Thursday, January 16, 2020, <whygee at f-cpu.org> wrote:

On 2020-01-16 04:04, lkcl . wrote:
 

the time (let alone rounding).  how do you *know* when the rounding (or the
last bit of the mantissa) is wrong?


That was my reaction :
if you *know* your LSB is wrong then you can correct it...

... or can you? this is what i'm fascinated to hear about, mitch. is there some mathematical way in which the accuracy can be computed yet the effort not known?
or... oh hold on, are you saying that the exception would be raised (every time?) then the partially-accurate result would be dropped into Newton Raphson for (probably only one iteration) to get full accuracy?
In my implementation, the number of exceptions raised is 1/243 of the number of calculations.
Once at the trap handler, one obtains the instruction and the operand and simply calls a functionthat can compute and correctly round the result. There are existent libraries that do this already.These functions have average run times of 300-odd cycles and worst case run times of 10K cycles.
l.


-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68



More information about the libre-riscv-dev mailing list