Yarn
Yarn copied to clipboard
Adding support for ieee754 32 bits floating-point instructions ?
Having support for 32 bit floating-point arithmetic would be great. :-)
I am open to discussing it, however this is design choice I intentionally made. I decided that if I wanted fractional numbers I could use fixed point arithmetic.
When I was looking into adding types (originally it was all signed int32s) I had a list of types I wanted:
- uint32
- int32
- char
- uchar
- float32
I then started thinking about it, realized I didn't really need to add suppot for char operations, especially since I only had 32 bit registers and it would be a bit convoluted and unnecessary to add. The float32 was different, and I wasn't sure how I wanted to do it. I then stumbled across the idea of doing all fixed point math, and realized thats how I wanted to do it, and didn't require adding any new operations.
So I guess my question is, aside from the obvious advantages, how would Yarn benefit from floating point rather than using fixed point ints?
Thanks for your quick response. The issue I see with fixed point representation, is that you have to keep track of the scaling factor when you divide or multiply. I thought it wouldn't be a lot harder than integer arithmetic, but I did not look at the way it works (at least for now) and you know much better than I do.