Linux now an equal Flash player (Linux-Watch)
Posted Oct 20, 2008 15:41 UTC (Mon) by jengelh
In reply to: Linux now an equal Flash player (Linux-Watch)
Parent article: Linux now an equal Flash player (Linux-Watch)
By my words, GCC internally could have something like:
if ((signed long)operand <= 0x7fffffff)
spewout(short opcode version, operand);
/* default */
spewout(long opcode version, operand);
With no option to tune it. Why would you even use the slower one when you can avoid it? It's not going to change anything... unless there is a bug in the CPU that causes the short opcode to go haywire.
Yes, malloc always returns a 64-bit quantity, and it does so in a register, which makes accesses cheap with small values:
int *x = malloc(sizeof(int)); *x = 5; equates to
mov dword ptr [rax], 5 which is the c7 00 code with a 32-bit operand for the "5".
to post comments)