Re: Does Casting Slow a Program Down?



"Serve Laurijssen" <ser@xxxx> writes:

Can integer casts generate extra instructions?

Yes; for example, to zero a register or to move data from a
register used for one size of data to a register used for a
different size of data.

How about floating point casts?

Yes.
--
"For those who want to translate C to Pascal, it may be that a lobotomy
serves your needs better." --M. Ambuhl

"Here are the steps to create a C-to-Turbo-Pascal translator..." --H. Schildt
.



Relevant Pages

  • Re: RE: Reboot on "shutdown -r" hangs after final "uptime ..." string
    ... Bit 12 of this register should ... be a zero before the write to do the reset is performed. ... that the 1->0 transition is immediate. ... SMI on OS Ownership Enable bit before clearing the EHCI_LEGSUP_OSOWNED ...
    (freebsd-current)
  • Re: void *malloc(size_t num_bytes);
    ... executing the VAX's normal subroutine-call instruction, ... (The startup code was thus at address 2. ... so the two zero bytes at location zero ... forgotten what the register setup was supposed to be, ...
    (comp.lang.c)
  • Re: Flags in CCR register after...
    ... with regards to what flags are set when the commands listed below are ... TSTA command tests register A for zero or minus -> A - $00 ... because a sub of 0 doesn't generate an overflow, ...
    (alt.lang.asm)
  • Re: Storage of Variables
    ... there were three memory "sections" called text, data, and bss. ... register statements are ignored and the ... malloc and local variables are undefined, static and global variables are always zero. ... All memory associated with the heap is guaranteed to be zero, ...
    (comp.os.linux.misc)
  • Re: cl.exe (x86 for amd64) bugs
    ... extend if the lower 32 bits are modified by an instruction. ... of some register and when your process is resumed, ... an interesting mix of promotions, non-promotions, default operand size, zero ... I just looked at the AMD web site and see some updates and new info on the ...
    (microsoft.public.development.device.drivers)