This demo (fpuDemo directory) shows how to use the floating-point unit to perform various mathematical operations such as calculating sine, cosine, tangent, square root, and division. The demo records the number of clock cycles needed to complete each calculation.
Users can turn off the floating-point unit in the SoC's IP Configuration wizard to compare the FPU results with those obtained using the base I-extension.
The processing time to obtain the results is faster, and the binary size is smaller when using the F/D-extension with the floating-point unit.
By default, newlib-nano is used for this demo.
If the user plans to use no standard library instead, the demo can still be run with our legacy bsp_printf by enabling ENABLE_FLOATING_POINT_SUPPORT in bsp.h.
The following shows the expected execution sequence: