integer*8 speed vs integer*4 speed 
Author Message
 integer*8 speed vs integer*4 speed

Does anyone know of the relative speed difference of generally
using integer*8 over integer*4 ?  Specifically in Win32.

Thanks,
Lynn McGuire



Sat, 15 Aug 2009 09:16:02 GMT  
 integer*8 speed vs integer*4 speed

Quote:

> Does anyone know of the relative speed difference of generally using
> integer*8 over integer*4 ?  Specifically in Win32.

It depends somewhat on the compiler, but it should be able
to do add, subtract, and multiply inline, about twice the time
for two add or subtract instructions instead of one.
Around four or five times as long for multiply.  integer*4
is one imull, integer*8 is two imull, one mull, two addl, and
about 9 movl.

integer*8 divide is done by subroutine call and might be significantly
slower, about 12 times is my guess, but it could be more or less, and
might depend on how big the numbers are.

-- glen



Sat, 15 Aug 2009 10:07:35 GMT  
 integer*8 speed vs integer*4 speed

Quote:
> 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



Sat, 15 Aug 2009 10:21:56 GMT  
 integer*8 speed vs integer*4 speed

Quote:

> Does anyone know of the relative speed difference of generally using
> integer*8 over integer*4 ?  Specifically in Win32.

> Thanks,
> Lynn McGuire

Why not test it and find out?


Sat, 15 Aug 2009 15:06:28 GMT  
 integer*8 speed vs integer*4 speed
Steve, has the lack of a controlling sortqq srt$integer8 constant (in CVF)
been rectified in IVF ?


Sat, 15 Aug 2009 17:19:36 GMT  
 integer*8 speed vs integer*4 speed

Quote:
> Steve, has the lack of a controlling sortqq srt$integer8 constant (in CVF)
> been rectified in IVF ?

Yes, and the generic QSORT now has an INTEGER(8) specific.

Steve



Sat, 15 Aug 2009 22:37:06 GMT  
 integer*8 speed vs integer*4 speed

Quote:
>> Does anyone know of the relative speed difference of generally using
>> integer*8 over integer*4 ?  Specifically in Win32.

> Why not test it and find out?

Because my current F77 compiler does not support integer*8 and
logical*8.  I am trying to move to the IVF 9.1 compiler but am having
many, many problems for my mixed F66 / F77 code (mostly zero
initialization problems).

Thanks,
Lynn



Sun, 16 Aug 2009 00:19:36 GMT  
 integer*8 speed vs integer*4 speed

Quote:
> Because my current F77 compiler does not support integer*8 and
> logical*8.  I am trying to move to the IVF 9.1 compiler but am having
> many, many problems for my mixed F66 / F77 code (mostly zero
> initialization problems).

Lynn,

If you need help, you can post in our user forum or contact Intel
Premier Support. See if the options /Qsave /Qzero help you.

Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

User communities for Intel Software Development Products
  http://softwareforums.intel.com/
Intel fortran Support
  http://developer.intel.com/software/products/support/
My Fortran blog
  http://www.intel.com/software/drfortran



Sun, 16 Aug 2009 02:07:01 GMT  
 integer*8 speed vs integer*4 speed
Hi Steve,

Quote:
>> Because my current F77 compiler does not support integer*8 and
>> logical*8.  I am trying to move to the IVF 9.1 compiler but am having
>> many, many problems for my mixed F66 / F77 code (mostly zero
>> initialization problems).

> If you need help, you can post in our user forum or contact Intel
> Premier Support. See if the options /Qsave /Qzero help you.

I have been doing this port for about 2 years now.  It always gets
thrown to the back burner for other issues though.  At the moment
I have some weird compile errors in my C++ code so I have to
get those fixed first.

Thanks,
Lynn McGuire



Sun, 16 Aug 2009 04:01:07 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Speed..Speed..Speed

2. Perl speed vs. Python speed

3. Java speed vs Tcl speed

4. Near Final PEP 237 - Unifying Long Integers and Integers

5. Revised PEP 237 - Unifying Long Integers and Integers

6. integer/integer division

7. Q: How to typecast integer to array of integers

8. INTEGER*4 --> INTEGER*2

9. It wants INTEGER*1 and NOT INTEGER*2 !?!?

10. How to treat INTEGER as INTEGER*2 in g77

11. integer*1, integer*2 in f90?

12. integer.and.integer

 

 
Powered by phpBB® Forum Software