A while back I ported gcc1.42 to Uniflex (see here: porting gcc1.42 to Uniflex)
Its always slightly bugged me that floating point doesn’t work with the gcc port. On the one hand I’m going to rewrite the floating point support on Uniflex which is…just terrible. But at the weekend I dived in to why double arithmetic doesn’t work and found that for functions that return a double (ie 8 bytes and larger than a 32-bit register), Uniflex runtime passes back a pointer in A0 to an 8 byte buffer! Specifically, gcc uses atof()
to parse float constants and gets back garbage in D0,D1…
gcc - expects return values in D0,D1.
Anyone know how you tell gcc to return doubles in a custom way? I guess the alternative is I wrap the Uniflex runtime functions in something that loads the result into D0,D1 - but it would mean wrapping every double returning function.