Re: integer*8 speed vs integer*4 speed



On Feb 26, 8:16 pm, "Lynn McGuire" <nos...@xxxxxxxxxx> wrote:
Does anyone know of the relative speed difference of generally
using integer*8 over integer*4 ? Specifically in Win32.

It depends. The "standard" IA-32 instruction set doesn't have
instructions for 64-bit integers. A compiler which supports INTEGER*8
can do add and subtract in two instructions, but multiply and divide
may take many more and might be done in a routine call. A lot of other
operations that could be done in an instruction will also be done with
calls.

IA-32 has few registers available, so an I*8 probably gets moved in
and out of memory more than I*4. Use of SSE instructions can help with
this. There is of course the fact that you're using twice as much
memory, so if you're moving a lot of data you're doubling the load.

A lot will also depend on the particular compiler you use and the
instruction set you allow it.

If you have an application that is heavily into I*8 you'd be better
off switching to Win64.

Steve

.



Relevant Pages

  • Re: new crop of quantitative measurements?
    ... orthogonal architectures from which to ... I'm obviously not the only one to have noticed this combination, since even x86 cpus contain a parallel approximate reciprocal square root lookup instruction in the SSE instruction set, giving about 12 bits. ... In a cpu company, software people are second-rate citizens, which tends to cause the hw guys to look down on them, which tends to cause the really good compiler people to seem alternate employment. ... is the modest fraction of the time that register pressure makes ...
    (comp.arch)
  • Re: RosAsm - right click
    ... writing an instruction that uses a variable ... variable...the immediate compiler should, of course, accept the ... want to see mostly mnemonics so put it back over to the left... ...
    (alt.lang.asm)
  • Re: Bad performance on alpha? (make buildworld)
    ... It's been a few years since I'd written a compiler, ... it is 4-way superscalar but the different execution ... instruction decode stages rather than just the integer pipeline), ... > architecture and relying on the L1 cache to handle the register spills ...
    (freebsd-performance)
  • Re: To Richard Heathfield: enoughs enough
    ... >> But if it is translated instead by an optimizing compiler to a single ... >> instruction the function becomes in practice O. ... practice of calling strlen in a loop is "on the order of quadratic n". ... law actually REDUCES the effective cycle time, ...
    (comp.programming)
  • Re: Java outperforms C++?
    ... > overlapped it is stopping some other instruction from overlapping. ... > Which C++ compiler uses GC? ... optimization is difficult and expensive. ... Decoupling the optimization from execution allows the optimization to ...
    (microsoft.public.vc.language)