Le 12/04/2016 06:36, Brian a écrit :
> On 4/12/2016 11:08 AM, Kustaa Nyholm wrote:
>
>> Every time I think of soft floats on 8 bit MCUs, they always end
>> up sounding better as 24-bit float formats... IIRC even 6502
>> Microsoft BASIC floats were formatted for easier byte-sized
>> handling. Is there no way of using 16 bit floats easily without
>> packing and unpacking?
> I checked the AppleSoft manual.  It had 5 byte "real" numbers
> (page 148 ), from -1E38 to +1E38, with about 9 digits of
> precision ( page 4 )[1].  That was my first computer with
> floating-point, and my dad's HP-45 was my first calculator.  :)

The fellow Amstrad CPC (Z80 4MHz 64kb RAM) also has 5-byte floats usable 
from BASIC and asm (but slow).

 From manual, section 4.7 page 90 "Real variables can take any value in 
the range 2.9E-39 to 1.73+38."
(edited OCR copy available on http://www.cpcwiki.eu/manuals/cpc464.en.rar).

>
> A 2-byte float sounds like a lot of bit-shifting and masking
> for not much range...

Similar gut feeling here.

On this platform (that SDCC targets, there are even high-level 
frameworks, see e.g. https://github.com/lronaldo/cpctelera ), I can't 
see a need for 16-bit float.

Non-time-sensitive applications would have better precision with 
built-in floats.
Time-sensitive applications would often be optimised for actually used 
ranges and most probably use fixed point pseudo-float (in 16-bit register).

Standard C float already provide a middle ground (speed, memory 
consumption) with the advantage of some portability.

What is left for those 16-bit floats? On other platforms maybe?

Regards.


-- Stéphane Gourichon


------------------------------------------------------------------------------
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

Reply via email to