Okay, I've got a PIC32 target board (PIC32MX440F512H @ 80MHz) and ran the Dhyrstone benchmark.
Setup | Cycles @ 80MHz | Dhrystone @ 80MHz | Code Size @ 80MHz | Cycles @ 20MHz | Dhrystone @ 20MHz | Code Size @ 20MHz |
No optimizations | 1312 | 762 | 17436 | 996 | 1004 | 17436 |
GCC optimize level 1 | 631 | 1584 | 15260 | 455 | 2197 | 15256 |
GCC optimize level 2 | 481 | 2079 | 15156 | 345 | 2898 | 15152 |
GCC optimize level 3 | 445 | 2247 | 15216 | 339 | 2949 | 15212 |
GCC optimize level 3 + unroll loops | 437 | 2288 | 15308 | 326 | 3067 | 15300 |
GCC optimize level s(ize) | 680 | 1470 | 15400 | 483 | 2070 | 15396 |
See text / speed | 423 | 2364 | 15308 | 326 | 3067 | 15300 |
See text / size | 1407 | 710 | 10552 | 1232 | 811 | 10548 |
After the standard GCC 0/1/2/s , I tried the following:
"Remove unused sections" -> Code size dropped to 14880 bytes, execution time increased to 445 (?). Slower, so I turned it off.
"Optimization level stdlib" set to level 3 -> 436 cycles / Dhrystone! (-1 cycle) Code is 16176 bytes (+868byte).
"Isolate each function in it's own section" -> 423 cycles / Dhrystone (-14 cycles /
2364 Dhrystone/MIPS). Code size was 15308 bytes (+0 bytes).
"Use legacy stdlib" -> Back to 439 cycles, code 33400 bytes. Nope, not attractive feature at all
"Generate 16-bit code" -> 803 cycles / dhrystone, code dropped to 15144 bytes. Quite a performance hit.
As personal interest, the smallest code I could get was 10552 bytes, with GCC 16-bit code, GCC optimize s, no unroll loop, remove unused functions, allow section overlap, optimize s for stdlib, 16-bit in linker (for stdlib?). Execution took 1407 cycles, though.
Now, I first did the test only @ 80MHz, wrote the above and thought "something doesnt seem right". As the 1.65DMIPS/MHz claim should give 2900Dhrystone/MIPS. I quickly thought about the FLASH accelerator, and I suspect it's not as agood as on most modern ARM chips or the new PIC32MZ. So I reran the test at 20MHz (which seems to run at full speed, e.g. lowering further doesn't yield faster results) and got these. They seem about right, or better than claimed.
Also glad to see the new PIC32MZ has a FLASH accelerator that should do the business @ full speed