Re: [cc65] Floating point support?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-10-03 22:27:18
On Wed, Sep 29, 2004 at 10:20:38AM +0200, Spiro Trikaliotis wrote:
>         Is suboptimal. wrt exponent      could be made optimal wrt.
>         processing (8 bit covered in     exponent processing
>         2 bytes)

This was was I meant with "Binary format is given and we have to live with
that." vs. "Format can be optimized for 6502."

Ok so, while I'm not 100% sure if this is the right decision, I would propose
a still to develop 6 byte format for cc65. Using something similar to the
turbo pascal format as shown by Sidney would probably be ok.

 47     40 39 38                                 0
  .-----------------------------------------------.
  | 8 bits |s|msb         39 bit mantissa      lsb|
  `-----------------------------------------------'
       |    |                  `------------  mantissa
       |    `-----------------------------  sign bit
       `--------------------------------  biased exponent (80h)

Since enough bits are available, I think that using an explicit '1' allows for
easier processing and detection of denormalized values (if necessary). The
question is if we need representations for NaN, Infinite, and so on. I've
checked the floating point format of the Texas TMS320 DSP, and it doesn't
support any special values. The IEEE Std. 754 format supports NaN and
Infinity.

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 Sun Oct 3 22:27:23 2004

This archive was generated by hypermail 2.1.8 : 2004-10-03 22:27:31 CEST