From: Philipp K. K. <pk...@sp...> - 2010-12-07 20:52:39
|
Am 07.12.2010 16:16, schrieb Lin Rongrong: > Just tested rev #6078, with TestBoolean function, the compiled size are the > same now, and "_Bool" is 4ms faster than "unsigned char". On an original Z80 _Bool should be exactly three clock cycles faster per loop iteration in your example. In terms of speed this is the main advantage of _Bool over unsigned char: saving three clock cycles each time we use it as a condition, be it in the ternary operator, an if/else or some other control mechanism. > Really a fast fix. > But I am still uncomfortable with "_Bool", as my overall code size is still > a little larger with "_Bool". Well there probably are still some places where sdcc generates unnecessary casts for _Bool, this will improve over time (and the improvmeent will be faster when users report the issue on this list (as you did) or as a feature request (which has the advantage of not being forgotten as easily)). Philipp |