Close

It floats!

A project log for Smaller C

Small and simple C compiler for x86 (DOS, Windows, Linux, Mac OS X) and MIPS (RetroBSD).

alexey-frunzeAlexey Frunze 01/17/2016 at 09:290 Comments

Late last year we made a series of improvements in RetroBSD and Smaller C (switched to compiling apps and libraries as MIPS16e, made numerous fixes and improvements in the emulator (including MIPS16e support) and shrank one large array in the compiler), which significantly reduced the compiler in size, like by 20+ KB. That extra space made me think of what else could be implemented or improved in Smaller C.

Of the largest language debts stood out floating point. I looked at it and decided to give it a try and it was perfect timing as the long Xmas/NY break was approaching. So, over the period of several weeks I've implemented and tested basic support for float. RetroBSD builds with double equivalent to float (32-bit single precision, software implementation as the PIC32MX CPU does not contain an FPU) and Smaller C follows suit.

This still is a work in progress and there are a few other limitations like several operators still unsupported with floats (++, --, +=, -=, *=, /=), but other than that things seem to be working quite well.

Hooray!

Discussions