Okay, when the XC language was first released, I understood that some capabilities, such as floating-point support wouldn't be available. The first versions of Occam didn't have floating-point. However, floating-point was quickly added to that language, and it's about time that it is added to XC.
I really like XC, but it's getting very annoying working around this particular deficiency. Sometimes, it's natural to place the floating-point-necessary code into it's own C file; but, often it is not.
What is so particularly hard or unnatural about floating-point that XC can't directly support it?
XC: About time for floating-point support
XC *can* support floating point... in software
Implementing floating point in hardware takes up a significant amount of space and it's really not that necessary as you can use fixed point math instead. The XC devices have a single clock MAC and support for doubles which should be PLENTY.
So to answer your question: The cost would go up, the system would get more complicated (you'd have to save all those FPU registers for each context, for example) and on a microcontroller, it's really not necessary IMO.
-Yvo
Implementing floating point in hardware takes up a significant amount of space and it's really not that necessary as you can use fixed point math instead. The XC devices have a single clock MAC and support for doubles which should be PLENTY.
So to answer your question: The cost would go up, the system would get more complicated (you'd have to save all those FPU registers for each context, for example) and on a microcontroller, it's really not necessary IMO.
-Yvo
He's talking about that C does have a floating point type whereas XC does not.yzoer wrote:XC *can* support floating point... in software
Implementing floating point in hardware takes up a significant amount of space and it's really not that necessary as you can use fixed point math instead. The XC devices have a single clock MAC and support for doubles which should be PLENTY.
So to answer your question: The cost would go up, the system would get more complicated (you'd have to save all those FPU registers for each context, for example) and on a microcontroller, it's really not necessary IMO.
-Yvo
XC now supports float types.
Wow! That's great! Was this announced? I can't seem to find anything about it at XMOS.com. The current XC Programming Guide http://www.xmos.com/node/14806?page=0 still says "XC does not support floating point, long long arithmetic, structure bit-fields or volatile data types, and no goto statement is provided."
The 12.0.0 beta tools add support for floating point and long long in XC (see the release notes here). The XC spec will be updated once the tools come out of beta.