hello
I tested library with FP (softfp) and FP instructions(hard) using the attached example.
I found that there is no difference in performance between these two floating-point operations. However, from this document(S32K14x系列MCU使用Tips之硬件FPU特性介绍和使用详解 ), it can be seen that hard uses fpu registers, which should have a more significant improvement in floating-point performance.
Now, I don't quite understand how to use hardware floating-point operations in S32K44
thanks
解決済! 解決策の投稿を見る。
Hi, @zhangchun ,
I understand looking at the screenshot that you got the no performance improvement.
But I feel it may be that because the test case you are trying for performance evaluation is not enough to test, if possible please can you try with more complex floating point operation and more iteration, and check what the result comes. Do also check the disassembly to see what is happening underneath.
Thank you. Kind regards.
- Mehul Patel
Hi, @zhangchun
Hard FP (floating point) will use the FP instructions of the device whereas soft FP will defer to software emulation of FP operations. That is, FP operations are performed by making a library call and the floating point operations are performed using integer instructions.
Now, another thing, you can check generate the disassembly file and understand the difference for different float ABI options - soft, hard, and library with FP.
Additionally, sometime compiler might optimization also play role, and if the operation is not resource intensive compiler might decide to do differently than you are expecting. You can also check different test case operation to ty out.
You can change the optimization settings and check accordingly if it improves the performance or not:
Please, can you check and tryout, let us know if you are able to get performance improvement accordingly.
Thank you, Best regards,
- Mehul Patel
Dear Mehul_Patel_NXP
I know that Library (soft) will take more time than Library with FP (softfp) or FP instructions (hard). However, FP instructions (hard) use FPU hardware registers, which should take less time than library with FP (softfp), but in reality they do not differ.
Based on your suggestion, I performed the operation by calling the function, and the result obtained was the same
My purpose in doing this was to use FP instructions (hard) to improve code execution efficiency, but the result did not achieve my expected goal. During this process, it was found that there was no difference between library with FP (softfp) and FP instructions (hard).
Currently, it has been determined to use FP instructions (hard) by reviewing the assembly and compilation parameters
Thank you for your response.
Hi, @zhangchun ,
I understand looking at the screenshot that you got the no performance improvement.
But I feel it may be that because the test case you are trying for performance evaluation is not enough to test, if possible please can you try with more complex floating point operation and more iteration, and check what the result comes. Do also check the disassembly to see what is happening underneath.
Thank you. Kind regards.
- Mehul Patel
Dear Mehul_Patel_NXP
I have a few more questions
Thanks