Hi,
I wrote a summation function in assembly and C respectively,and then we put each of them in the loop.
I found a 10-fold difference in the number of execute cycles,why does this happen?
Attach my code as well.8228.cycle_test.rar
ADSP-21569
Recommended for New Designs
Reaching speeds of up to 1 GHz, the ADSP-2156x processors are members of the SHARC® family of products. The ADSP-2156x processor is based on the SHARC...
Datasheet
ADSP-21569 on Analog.com
Hi,
I wrote a summation function in assembly and C respectively,and then we put each of them in the loop.
I found a 10-fold difference in the number of execute cycles,why does this happen?
Attach my code as well.8228.cycle_test.rar
Ranji - Moved from ADSP-2156x to CrossCore Embedded Studio and Add-ins. Post date updated from Sunday, July 7, 2024 1:15 AM UTC to Monday, July 8, 2024 5:14 AM UTC to reflect the move.
Ranji - Moved from ADSP-2156x to CrossCore Embedded Studio and Add-ins. Post date updated from Monday, July 8, 2024 5:14 AM UTC to Monday, July 8, 2024 5:14 AM UTC to reflect the move.
Hi Binge,
Thank you for your inquiry. We are looking into your query. We will get back to you soon.
Best Regards,
Santhakumari.K
Hi,
The cycle count for the Assembly function would be higher than the optimized C-code (for speed), whereas it would be lesser than the un-optimized C-code.
This is because the compiler writes code really efficiently when the optimization is turned ON. The effect of the memset instruction is because of the compiler optimization having been turned ON. In this case, the generated code will be different from the straight translation of the C-code that you would expect.
The code has been optimized for speed, that is, for execution in less number of cycles. If the compiler optimization is turned OFF, this difference will not be noted. The best way to answer most of such questions is to compare the generated assembly code in the disassembly window.
For mode details, please go through the below linked Ezone thread and project "Dot_modified.zip" from the same link:
https://ez.analog.com/dsp/sharc-processors/f/q-a/60690/why-is-assembly-dot-product-slower-than-manually-developed-c-code/184566
Hope this helps.
Best Regards,
Santhakumari.K