On 4/13/2016 8:25 AM, alvin albrecht wrote: > >SDCC currently implements 32-bit float as its only > floating-point data type. > >Would you like to see a cheaper one in SDCC, that uses only 16 bits? > >Would you use it? > My answer is yes, sort of (fuller explanation below : ) > For any 8-bit microcontroller without hardware floating point, > floating point is not about performance it’s about convenience.
I don't think any of us disagree with the convenience thing. But is anyone actually using 16 bit floats for their apps or projects? The biggest problem is the 11 bit precision -- 8 bit MCUs probably calculate using 16 bits of precision and then unpack-pack into the half float format. Right now I am really really interested in seeing a real life 8-bit MCU program that uses 16 bit floats, or something very close in spirit... > [snip] > One of the world’s smallest chess programs. Shockingly it uses > floating point: > http://z88dk.cvs.sourceforge.net/viewvc/z88dk/z88dk/libsrc/_DEVELOPMENT/EXAMPLES/umchess.c?revision=1.2&view=markup Ummm... where are the floating point declarations? > [snip snip] > What I am getting at is, ideally, we’d be able to tell the > compiler what the floating point format is at compile time so that > these runtime conversions don’t have to be made. That might be > pie in the sky; another alternative is to define generic float > operations on short floats, floats and/or doubles with the > compiler assuming each type is x,y,z bits in width. It is then > the responsibility of the library to assign meaning to the bits > and to implement the defined float interface. This would solve > our runtime conversion problem and it would allow us to define > short floats to actually be fixed point where advantage could be > gained from that without taking away from the possibility of other > math libraries defining short floats differently such as ieee. Very nice, if only someone had a metric truckload of time to expend on it. But earlier it sounds like you would very much like floats used in old 8-bit computers. I don't think it would be as easy as defining widths, and maintaining such things is something dedicated retrocomputing developers need to do, IMHO we should not burden folks like the SDCC devs with a ton of legacy requirements. -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user