Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

SDK • Re: the RP2040 in C and command lines (le RP2040 en C et lignes de commandes)

$
0
0
What optimisation level was that compiled with and does the assembler change with -O2?
That was with the default which I believe is -O3. Using -O2 and -O1 it's the same. Using -O0 adds quite a lot more.
Thanks for the reply. I'm surprised both versions don't optimise down to the exact same code, or at least the same with r2 and r3 swapped.

To me the differences reflect the habit of gcc to precompute constants and put them in memory. These days memory is slow and compute fast; therefore, this could be viewed as bad habit dating back to early times, or not. I could be completely misunderstanding what's going on.

Statistics: Posted by ejolson — Thu Nov 20, 2025 5:29 pm



Viewing all articles
Browse latest Browse all 8093

Trending Articles