[cc65] floating point support redux

From: Kevin Schuetz <scrapdog1runbox.com>
Date: 2010-04-02 07:14:43
Not much has been said about floating point support for a while now.

Maybe it is time to revive the discussion?

Before even a decision is made on what formats to use for floating point 
support, there exists the problem of the compiler treating floating 
point expressions the same way that the target does.

What do you think of these two ideas?

-----------------------------------

1.  A 6502 simulator that can be employed by the compiler, linker, and 
assembler at compile/link/assemble-time.  This simulator would execute 
the same 6502 routines that will be used in runtime library for floating 
point operations.

Pros:  the floating point routines would only have to be written 
*once*... in 6502.  And they will behave the same regardless of the 
environment that the compiler is running on.  Changing formats would 
only require rewriting the 6502 routines.

Cons:  requires the simulator.  Not a huge con, as that could be fun to 
write. :-)
And this might introduce a chicken-and-egg problem in building CC65, but 
I'm sure this could be solved with some cleverness.

-----------------------------------

2.  Link the compiler with MPFR/GMP

Pros:  platform-independent floating point support for the compiler.  
Could easily support any format decided on without having to care about 
the compiler environment.

Cons:  floating point routines would still need to be written for the 
6502.  Two extra dependencies to make CC65 more difficult to build.  
Possible licensing issues.

-----------------------------------

Regards
Kevin
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Apr 2 07:14:53 2010

This archive was generated by hypermail 2.1.8 : 2010-04-02 07:14:56 CEST