SMMUL and other intrinsics, debugging strategies


#1

What does the function __SMMUL do?

Is there a proper documentation accessible?

Is it more efficient to implement this function over writing c code into the object definition?

What is the best way to debug parameter values? I used an additional output and a display object but this seems a bit complicated.


Help with division and multiplication of float values [solved]
#2

__SMMUL is a ARM Cortex-M4 processor intrinsic function. It's a convenient C function that maps to an assembly opcode. Convenient, in the sense that it avoids the pain of coding in assembly.

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/CHDHGFEF.html

Using intrinsic functions is not strictly required to get good performance, the compiler can be pretty smart too.
Sometimes plain C does not make it easier to recognize the function, like SSAT would require expressing two conditions in C.
Sometimes I don't think the compile could recognize every intrinsic function from a general expression.
The other way around, most math-related intrinsics can be replaced with processor-independent generic C code.

Adding a temporary outlet for debugging is an approach I often use.
LogTextMessage() with printf-style format arguments can also be useful to dump values to the Axoloti console window, but take care to throttle them, printing at sample or control rate will cause a flood. The printf-parameters are less flexible than the standard CRT library - check http://chibios.sourceforge.net/html/group__chprintf.html