Re: [cc65] floating point support redux

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-05-01 18:41:12
I digged the following out of the trash.

Please keep in mind that the mailing list software will drop anything that has
too much quoted material, big attachments or whatever. If you don't get your
mail back from the mailing list, something went wrong. Unfortunately, I cannot
reconfigure majordomo to notify the sender, so in these cases it just gets
lost - provided that I don't check the trash, which I usually don't do.

On Thu, Apr 29, 2010 at 12:05:11PM +0200, Karri Kaksonen wrote:
>  From a game writer's perspective the nice things in floats is to be
> able to multiply by cos or sin.

The snapshot contains routines for this purpose. They use a fixed format,
however.

> I would prefer IEEE754 half precision implementation to 16 bit floats.
> It saves space and it is hopefully faster than 32 bit stuff.
>
> The minimum strictly positive (subnormal) value is 2-24 ? 5.96 × 10-8.
> The minimum positive normal value is 2-14 ? 6.10 × 10-5.
> The maximum representable value is 65504.

Now that's an idea. I have more or less abondoned the idea of standard
compliance with regard to floats, because 64 bit IEEE is definitely useless
for all practical purposes, 32 bit IEEE is not sufficient for a standard
compliant double data type, and an additional data type between 4 and 8 bytes
is non standard and has a high code overhead, because additional runtime
support routines are necessary, even for movement and stack operations.

So if cc65 isn't going to have a standard compliant floating point type
anyway, why not use IEEE single precision for "double" and IEEE half precision
for "float"? This might actually be a viable solution for both types. Does
anybody have experiences with this format?

The half precision format is explained here:

  http://en.wikipedia.org/wiki/Half_precision_floating-point_format

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat May 1 18:41:25 2010

This archive was generated by hypermail 2.1.8 : 2010-05-01 18:41:28 CEST