The 8051 is not a good core for C. This might be one reason for the long instruction sequences generated. I can somehow understand that the sdcc developers don't put much effort in optimizing the compiler for a nearly dead old architecture. - Heinz
Hello, are there any intentions to improve the optimizer? There are some code patterns that could be easy to optimize. I have an example where two bytes should be converted to one 16-bit unsigned. Here the example function: uint16_t ReadTimer(void) { return (TH2<<8) | TL2; }//ReadTimer compiling with option --opt-code-speed Resulting code is _ReadTimer: ; Timer.c:79: return (TH2<<8) | TL2; mov r7,_TH2 mov r6,#0x00 mov r4,_TL2 mov r5,#0x00 mov a,r4 orl a,r6 mov dpl,a mov a,r5 orl a,r7 mov dph,a ret...
Worked, but I also have to add __data to the declaration of p1_val
expression with bool result assigned to bitfield generates wrong code
Hello, I wanted to define a byte variable in the bit-addressing area. Then I want...