Page 2 of 2

Re: Looking for floating point libraries

Posted: Sun Jun 15, 2025 1:29 pm
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

Re: Looking for floating point libraries

Posted: Sun Jun 15, 2025 1:54 pm
by BigEd
(Welcome, zu2! You have some interesting blog posts about benchmarking, thanks for sharing)

Re: Looking for floating point libraries

Posted: Sat Aug 09, 2025 9:36 am
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...