Will ESP32-S31 GCC support autovectorization?
For PIE to have been on devices like P4 and S3 now for several years, there's been little official doc about it. There was a
blog post or two, and a few good posts by other random internet guy, but official doc has been slow to reach fruition and most of what's known about it seems to come from taking apart the code snippets in the DSP and DL libraries.
The P4 TRM, last time I looked, still had PIE as "0%: this section is not complete" but I see now it's been updated with enough info to safely boot the device and run binaries (e.g. not trounce the registers during a context swich or interrupt) with PIE sections. It now proudly announces that it's compliant with "Espressif’s PIE V2.2.0" but variations of that term in search lead to dead ends.
Autovectorization requires a lot of compiler chops. Since they went on their own, they can't ride the tails of Andes or other subsets of RISC-V Vector that more closely resemble SIMD-era stuff. But we can somewhat answer the question since the compilers are open source. Peek in
https://github.com/espressif/gcc/blob/e ... ressif.def for RISC-V or
https://github.com/espressif/gcc/blob/e ... /xtensa.cc for Xtensa (and siblings in their respective directories) and find that GCC seems to know next to nothing about the RISC-V extensions and the limit of Espressif-specific magic in XTensa is a workaround for a silicon defect in the original ESP32.
Perhaps you'll come to a different conclusion, but my study of the Xtensa and RISC-V directories in
https://github.com/espressif/gcc/ as well as roaming through the crosstools-ng finds only relatively small (e.g.
https://github.com/espressif/crosstool- ... d96f66c4f8) changes make over vanilla GCC. I see an enthusiastic maintainer (the last commit was 52 minutes ago. It's 05:24A in parts of North America, so it's either a fellow insomniac or someone in Asia) but I don't see evidence of autovectorization.
I could be wrong. (But I've never once seen anything but vanilla RISC-V in any of the P4 code I've disassembled.)
It seems that PIE support isn't really documented and the only customer is really the guys down the hall working on the libs with hand-coded assembly that don't even really use the assembler; they construct the opcodes in true artisan style.
Don't expect strlen to be inlined to even zero-overhead loops and certainly don't expect your operator + Vec3d[] to bowl you over.
Maybe I'm wrong. Maybe it's there. Maybe GCC 16.2 patches are in the wing.
Pretty much I have to assume that PIE does nothing for me. I don't even expect
std::experimental::simd to do anything special for them.