[CCC DEV] Floating point on Arduino...

Adam Sampson ats at offog.org
Wed Jun 9 16:55:00 BST 2010


Matt Jadud <jadudm at gmail.com> writes:

> How ugly would it be for us to add floating point to the VM on the
> Arduino?

If you mean adding the floating-point instructions, it'd mean making it
emulate a kind of Transputer that never existed, which I would imagine
would have interesting consequences elsewhere in the toolchain. ;-) I
think we're better off sticking with the T2 model, at least to start
with.

Having just tried to write a little Arduino program that uses floating
point, it gets most of the way there, calling correctly into the 16-bit
software FP helpers in the forall library. What's stopping my test
program from working is that every REAL32 constant in the program gets
emitted as 0x00000000 by the compiler! I have a vague recollection of
having seen this problem before -- does it ring bells with any of you
guys?

(I'll admit to having spent a little while staring at the bytecode for
REAL32OPERR and wondering why on earth 3.0/2.0 was causing a divide by
zero error, before actually going and looking at the values
themselves...)

Thanks,

-- 
Adam Sampson <ats at offog.org>                         <http://offog.org/>




More information about the developers mailing list