On Thursday 07 September 2006 17:09, Jerry Feldman wrote:
On Thursday 07 September 2006 2:56 am, Jan Engelhardt wrote:
Every use of uint64_t in code will be emulated by gcc for 32-bit archs. Which seems, from the asm dump, costly.
While this is true, let me restate it. In a 32-bit application (under a 32-bit OS or a 64-bit OS), the application only has 8 32-bit registers, so the C language types: long long, int64_t, uint64_t will require multiple register loads as well as a couple of operations. So, in pseudo assembler code: int64_t x, y, rc; load x (low order 32 bits) into reg a1 load y (low order 32-bits) into reg a2. Add a1 and a2 storing result in reg a1 Store result into rc (low order 32-bits) load x (high order 32 bits) into reg a1 load y (high order 32-bits) into reg a2. Add with carry a1 and a2 storing result in a1. Store a1 into rc (high order 32-bits). In this case, you've got to do 4 loads, 2 adds and 2 stores. In a 64-bit system there are 2 loads, 1 operation, 1 store. --
Hi So to answer my original thread question (in simple terms) are you saying that fewer loads, operations and stores makes the 64 bit faster? The less the processor has to do the faster it will finish the task? Steve.