top | item 34032016

(no title)

chadaustin | 3 years ago

I was also surprised by how suboptimal avr-gcc's generated code is. On the other hand, the AVR experience is reminiscent of early DOS, terrible C compilers and all, so it remains nostalgic!

Two examples: https://gcc.godbolt.org/z/M4oasdK4a

* Population count: I haven't found a way to convince AVR-GCC to use LSR's shift into carry with ADC.

* Strength reduction: AVR doesn't have a barrel shifter, so it's a huge win to incrementally shift during the loop. AVR-GCC doesn't see this.

discuss

order

No comments yet.