Some questions about the C -Optimise - (nf)
emrath at uiucdcs.UUCP
emrath at uiucdcs.UUCP
Thu Jun 16 18:32:05 AEST 1983
#R:edai:-208300:uiucdcs:13700036:000:829
uiucdcs!emrath Jun 16 02:40:00 1983
I have a thought about the second optimzation question, in the case
of the instruction t = s & 0xffffff; /* s and t are int's */
I have noticed that the optimzer does a fair job at reducing the size
of the code generated. It seems to strive for this, possibly under the
assumption that shorter code might be expected to execute faster
(in general, this seems like a good rule of thumb).
In this case, the optimzer generates:
extzv $position,$size,source,destination
rather than:
bicl3 $mask,source,destination
The mask requires 5 bytes of code (in general), while the position and size
are small integer constants and only require 2 bytes.
Maybe this was the reason that extzv was used instead of the bicl3, that
the implementor(s) didn't have time to run speed tests on every possible
optimization. I'm just guessing.
More information about the Comp.unix.wizards
mailing list