Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

Performance between 32 bit and 64 bit application

Uday_Krishna__G_
887 Views

Hi All,

Am coding the my Video codec application in Intel 32 bit assembly using the ICC compiler. I would like to know how much performance gain will be there in 64-bit coding?

Like in contrast how much percent performance gain between 32-bit and 64 bit coding of the same application?

0 Kudos
13 Replies
Bernard
Valued Contributor I
887 Views

I suppose that bulk of the processing will be done by vector execution unit(s) on 128bit and 256bit vectors either if your codecs are 32-bit or 64-bit.

0 Kudos
TimP
Honored Contributor III
887 Views

Write it portably so you can test. Assume you arent needing the expanded register set or addressing so there may be little in it or even a loss due to big pointers.  If you use 64-bit integers (which are a native data type in 64-bit mode), you may find an advantage.

0 Kudos
jimdempseyatthecove
Honored Contributor III
887 Views

The code size (bytes) will be larger in the 64-bit variation, however you have more and wider GP registers in 64-bit. If you can make use of the additional registers and the wider GP registers then you may see a gain in going to 64-bit.

Jim Dempsey

0 Kudos
Bernard
Valued Contributor I
887 Views

@Uday

Are you writing your codec completely in assembly or just using inline assembly to optimize crucial part of the code?

0 Kudos
QIAOMIN_Q_
New Contributor I
887 Views

Since you are using Video codec application ,i think it would benefit a lof from more available registers and more accessible memory in 64-bit application ,additionly ,compiler would make more mature/bold optimizations in 64-bit mode .

0 Kudos
Uday_Krishna__G_
887 Views

@Iliyapolak

Am writing the separate assembly function for crucial part in my application and calling the function from C code, like inline assembly functions.

0 Kudos
Bernard
Valued Contributor I
887 Views

@Uday

In MASM?

0 Kudos
Uday_Krishna__G_
887 Views

@Iliyapolak

Yes.

0 Kudos
kiran_N_
Beginner
887 Views

Hi...

PLMK is my understanding is correct..

-> Using a 32 bit (or) 64 bit OS will not make any performance difference if i am not using AVX instructions (since i work only on 128 bit registers).

-> Code size increases if its an 64bit OS? Why is it so? if there is no performance difference?

Thanks in advance

Regards,

Kiran.

0 Kudos
TimP
Honored Contributor III
887 Views
Avx gets no inherent gain from 64-bit mode. Some past compilers would do more effective default unrolling. Usual reason already quoted for increased memory usage is pointer size.
0 Kudos
kiran_N_
Beginner
887 Views

@ Tim Prince,

Can u pls let me knw

1) difference between 32bit and 64 bit code (performance, memory fetch cycles).

2) Guidelines to be followed during development, with intention of porting it to 64 bit (Assuming the code for 32 bit is to be started newly)

Regards,

Kiran

0 Kudos
TimP
Honored Contributor III
887 Views

Basic instruction performance (which you can look up in the CPU manufacturer's or Agner Fog's docs) doesn't change between 32- and 64-bit mode.  The obvious exception is for 64-bit integer operations which have to be broken down to 32 bits for 32-bit mode (compilers do this automatically).  You probably need to tune your code so as to avoid TLB misses which could have differing impact.

Probably the first guideline would be to heed Microsoft's advice to use intrinsics rather than assembly (a must if you use their compiler).  You would use size_t and ptrdiff_t properly so as to make the changes happen automatically, at least according to the range of compilers you intend to target.

If you want to take advantage of the additional registers in 64bit mode (32-bit mode has only 3 64-bit integer registers) there may not be much you can do portably without hurting 32-bit performance (not something I have direct experience on).

You might (or might not) find another discussion forum more closely attuned to what you want to do.  icc on linux or MAC ought to share many best practices with gcc.  

0 Kudos
kiran_N_
Beginner
887 Views

Thanks a lot for info...:)

 

0 Kudos
Reply