-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poor RISC-V pico_riscv_gcc_zcb_zcmp
performance
#1937
Comments
This is intriguing. Could you do a verbose link with the xPack toolchain (the official release, with all libraries) and check what library was actually used, then with your trimmed xPack, and compare the results? |
I'll take care of it for sure later in sunday, but now what I have from the past: on Windows, CORE-V required leaving (with original Pico SDK) Just for the record - what is previous is about Ubuntu 20.04. Last word for now - it seems like it can pick up from multiple matching libraries, whichever is available. |
Back to vanilla Pico SDK. I don't really know, how to check, which library is picked up, but removed all libraries including a default one in that two directories and xPack has four
so replacing one by one as a default one, so only default library was present. Compilation was successfully every single time, program was working every time on Pico 2 but inly when PS. Replacing libraries of xPack with ones from pico-sdk-tools created fastest performing binaries (but still tinier bit slower than Pico at the same clock):
Some conclusion might be adding extra libraries like in Raspberry Pi Pico-series C/C++ SDK, page 30, but adding |
Try adding |
Tried
Files renamed due to Github requirements. Ori (apart from extra PS. Changing:
to
inside PS2. Adding two extra directories with libraries from
and it still picks up like above. I wonder how behaves proper |
Sure it does nothing, since you have to add it to Otherwise, if you use |
Thanks for CMake tip, was struggling with that one. More I dig into it less I know. But leaving inside xPack |
Something went wrong. |
I think in the longer term we would like to move away from CORE-V; really that CMake option exists because we used CORE-V to build the C parts of the RISC-V bootrom, as there was no upstream GCC support at the time. |
As maintainer of a RISC-V toolchain from the very early days (xPack RISC-V GCC), I had to fight a lot of issues with merging various forks. A 0.8% speed increase or a 0.5K/47K size reduction are not worth the effort. Therefore I suggest you generally stick close to the official GNU GCC distribution. |
For the ROM this was the right choice, but for all other purposes yes, this is vestigial and I would like to remove it now that upstream Zcmp support is in a better place. |
Now I have a performance issue. Compilers like CORE-V are huge in size, so decided to trim them down a bit. One thing is to leave only default library, by deleting all extra ones inside:
did a trick. BTW same for ARM.
Today I've got my Pico 2, but noticed something before. Having only default lib, binaries had different size compared to vanilla compiler. Now tested both, and when using pico_riscv_gcc everything's fine.
But for vanilla CORE-V and pico_riscv_gcc_zcb_zcmp it compiles fine, but performance is poor. I have some air mouse from an accelerometer at 6664 Hz, and RISC-V is a bit slower on Pico 2 than M0+ on Pico, but it was still able to keep up with a stream of data and moving average and stuff. Creating monster
pico_riscv_gcc_zcb
, that ispico_riscv_gcc_zcb_zcmp
without_zcmp
behaved similar.Removing extra libraries from CORE-V (same with xPack) resolved an issue. Now both
pico_riscv_gcc_zcb_zcmp
andpico_riscv_gcc_zcb
are performing better thanpico_riscv_gcc
. It is latest 14.1.0 GCC CORE-V. Default library isrv32imac/ilp32
. Avoiding shenanigans with tuning compiler, changing:to
resolves poor performance issue for pico_riscv_gcc_zcb_zcmp. Same works for xPack.
PS. I propose to create
pico_riscv_gcc_zcb
. For CORE-V 14.1.0 GCC it performed better thanpico_riscv_gcc_zcb_zcmp
. First had 2,7% performance boost, latter 0,19% in comparison withpico_riscv_gcc
PS2. Noticed extra toolchain release in pico-sdk-tools, I'll give it a try.
The text was updated successfully, but these errors were encountered: