[libre-riscv-dev] IEEE754 FPU

Aleksandar Kostovic alexandar.kostovic at gmail.com
Mon Feb 11 11:42:53 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...


It's a nice repo and definitely has simple and relatively easy to
understand C code. I am not using C for 25 years(!!!) as you do though. I
am familiar with it but rarely use it. Plus I am more of C++ fan :P (yes I
know that you can use C++ as pure C).

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 have to admit that this FPU has me thinking quite a bit. It's not as easy
as I thought to wite Migen so that requires some time. It's much easier to
build a simple ALU for integer stuff in a CPU than it is to build FPU.

even the functions
> like packToF32UI could potentially be blindly replicated with hardware
> variants..


For me it's not that easy. I am used to thinking of something from my head
than implement it. This is a bit new to me but I am positive that we can do
it. I haven't written any code yet cuz migen, but once i get it fully i
will start the development. Now its just small examples until i figure it
out (passing "self" to everything is a bit strange to a C/C++ guy).

i leave it up to you to decide? :)


Not sure yet actually. There are a lot of stuff to figure out :)

On another note - i apologize if i had been a bit inactive as i had to deal
with some stuff in life, but i am actively thinking about this. So sorry
for inactivity :)

On Mon, Feb 11, 2019 at 11:50 AM Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:

> 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.
>
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev at lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
>


More information about the libre-riscv-dev mailing list