Looking for floating point libraries

Programming the 6502 microprocessor and its relatives in assembly and other languages.
zu2
Posts: 3
Joined: 15 Jun 2025
Location: ryukyus.
Contact:

Re: Looking for floating point libraries

Post by zu2 »

BillG wrote:
I know you want something with a permissive license.

I am not a patent lawyer and I do not play one on television; if you were to paraphrase code from one processor architecture to a different one, is the result considered to be infringing? If not, that may be a relatively easy way to get there. I have always presumed that to be safe; it is not unlike coding from an algorithm in a book or journal.

Floating point code has been published for the Motorola 8-bit processors. Same for 8080/Z80. Source code for 8087 emulation from the Borland compilers (80x86) is also out there.

Are you picky between BCD versus binary?

A long time ago, I set out to write IEEE 754 compliant floating point for the 6800. I have single precision generally working but have yet to work out how to implement the guard, round and sticky bits. Because the AVR instruction set looked so easy to program, I also built a version for that. Future steps:

* Figure out the guard, round and sticky bits
* Improve the speed
* Implement 6-byte, double and extended precision
* Port to other processors
I am very interested in your work on implementing IEEE 754 compliant floating point arithmetic for the 6800. I am also developing a C compiler for the 6800 with support for IEEE 754 32-bit floats, and my floating point library already implements even rounding using guard, round, and sticky bits. However, I am still not completely satisfied with the performance.

If you have any resources, optimization techniques, or advice for improving speed, I would greatly appreciate your input. I believe that by sharing our experiences, we can both enhance our projects. I look forward to exchanging ideas with you.

https://github.com/zu2/chibicc-6800-v1
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Looking for floating point libraries

Post by BigEd »

(Welcome, zu2! You have some interesting blog posts about benchmarking, thanks for sharing)
BillG
Posts: 710
Joined: 12 Mar 2020
Location: North Tejas

Re: Looking for floating point libraries

Post by BillG »

zu2 wrote:
I am very interested in your work on implementing IEEE 754 compliant floating point arithmetic for the 6800. I am also developing a C compiler for the 6800 with support for IEEE 754 32-bit floats, and my floating point library already implements even rounding using guard, round, and sticky bits. However, I am still not completely satisfied with the performance.

If you have any resources, optimization techniques, or advice for improving speed, I would greatly appreciate your input. I believe that by sharing our experiences, we can both enhance our projects. I look forward to exchanging ideas with you.

https://github.com/zu2/chibicc-6800-v1
I have not worked on it in quite awhile. I have not done any performance testing with it until it is fully functional. I am sure it is not fast...
Post Reply