« Return to Thread: Is Hitech C deliberately slugging code in the free version..?

Is Hitech C deliberately slugging code in the free version..?

by Mike Harrison :: Rate this Message:

Reply to Author | View in Thread

I've not used C on a PIC for a while - thought things were rtunning a bit slowly on a 16F818
project. Looked at some code and was staggered by how badly it was generating code for trivial
operations
A couple of snippets :

313:               irtmr1+=bittime2;   // bittime 2 is a constant, irtmr1 is a global char
   090    300D     MOVLW 0xd
   091    00F2     MOVWF 0x72
   092    0872     MOVF 0x72, W
   093    07F8     ADDWF 0x78, F

Four instructions where two would do

314:               ircnt1++;
   094    3001     MOVLW 0x1
   095    00F2     MOVWF 0x72
   096    0872     MOVF 0x72, W
   097    07FC     ADDWF 0x7c, F

Four instructions where one would do.

 "Running this compiler in PRO mode, with Omniscient Code Generation enabled,
produces code which is typically 52% smaller than in Lite mode."

So does 'Omniscient Code Generation' just mean doing things properly?

I can't help but think that Microchip shipping something as poorly performing as this, even for
free, can't be doing them any favours winning potential customers as it just makes the silicon look
bad.



--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

 « Return to Thread: Is Hitech C deliberately slugging code in the free version..?