[libre-riscv-dev] IEEE754 FPU

Luke Kenneth Casson Leighton lkcl at lkcl.net
Mon Feb 11 10:49:37 GMT 2019


hiya aleksander,

so what did you think of the softfloat source code?  personally, i
find c quite easy to read, that's most likely due to having used it
for um 25 years? :)

s_addMagsF32.c for example, it's pretty clear that it starts off with
the case when the exponents are the same.  where they're different,
one mantissa is shifted (reduced in magnitude) to match the larger
exponent of the two numbers.

there's some complicated voodoo involving 0x20000000 and 0x40000000
which could be blindly replicated as bitfields... even the functions
like packToF32UI could potentially be blindly replicated with hardware
variants...

with apologies, my mind often thinks "how can the goal be achieved
with the minimum amount of thought, effort and likelihood of
mistakes?" - it *doesn't* think, "this would be fun to do entirely
from scratch! yay!" :)

i leave it up to you to decide? :)

l.



More information about the libre-riscv-dev mailing list