Home > Archive > Fortran > February 2007 > integer*8 speed vs integer*4 speed
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
integer*8 speed vs integer*4 speed
|
|
| Lynn McGuire 2007-02-26, 10:08 pm |
| Does anyone know of the relative speed difference of generally
using integer*8 over integer*4 ? Specifically in Win32.
Thanks,
Lynn McGuire
| |
| glen herrmannsfeldt 2007-02-26, 10:08 pm |
| Lynn McGuire wrote:
> 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
| |
| Steve Lionel 2007-02-26, 10:08 pm |
| On Feb 26, 8:16 pm, "Lynn McGuire" <nos...@nospam.com> 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
| |
|
| Why not just run a timing test on your compiler? Time how long it takes to do some operations 10000 times. Won't take long to write and won't take long to run. In an hour it will tell you what your compiler will do.
It takes a lot longer to research such things than to just do it. | |
| Gib Bogle 2007-02-27, 8:08 am |
| Lynn McGuire wrote:
> 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?
| |
| David Frank 2007-02-27, 8:08 am |
| Steve, has the lack of a controlling sortqq srt$integer8 constant (in CVF)
been rectified in IVF ?
| |
| Steve Lionel 2007-02-27, 7:09 pm |
| On Feb 27, 4:19 am, "David Frank" <dave_fr...@hotmail.com> wrote:
> 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
| |
| Lynn McGuire 2007-02-27, 7:09 pm |
| >> Does anyone know of the relative speed difference of generally using
>
> 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
| |
| Steve Lionel 2007-02-27, 7:09 pm |
| On Feb 27, 11:19 am, "Lynn McGuire" <nos...@nospam.com> wrote:
> 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
|
|
|
|
|