Operating System - HP-UX
1846418 Members
3051 Online
110256 Solutions
New Discussion

Re: 32bit and 64bit difference

 
SOLVED
Go to solution
Max_4
Frequent Advisor

32bit and 64bit difference

Hi all,

I was trying to look for some information about what's the difference between 32bit and 64bit executables. And I have a question does 32bit/64bit refers to size of internal registers of the processor architecture or does it relate to something else?

Another question what does 'memory alignment' means?

Thanks to all in advance....
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: 32bit and 64bit difference

The answer to both questions is yes. First, the processor may only have 32-bit registers and is thus incapable of running 64-bit code (except possibly in emulation). The code also becomes 64-bit in that various operands might change size. For example, pointers in 32-bit code might be four bytes and 8 bytes in 64-bit code. Typically ints and longs are the same size in 32-bit land but differ in 64-bit land.

In the HP-UX world, 32-bit code will execute on 64-bit processors but the converse is not true. THe biggest difference is the amount of address space that each can access; in almost all cases, 64-bit is not faster than 32-bit. You should really think of the difference as a resource enabler rather than a performance enhancer.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: 32bit and 64bit difference

Oops, I missed part of your question. Memory alignment refers to how data is organized within the address space.

e.g. consider this strut:
struct xx
{
char c; /* 1 byte */
int i; /* 4 bytes */
double /* 8 bytes */
char string[12]; /* 12 bytes */
} x;

Now you might expect that struct to occupy 25 bytes but it almost certainly won't. The details vary between architectures and compiler options used but in almost every case, at the very least, a 'hole' is left in the following the char c variable. The memory access is much more efficient if it occurs on word size boundaries. A tradeoff is made between memory usage efficiency and speed of memory access usually in favor of speed.

If it ain't broke, I can fix that.
Cheryl Griffin
Honored Contributor

Re: 32bit and 64bit difference

Clay's done a good job explaining, here's some extra info.

There's a lot published on 32/64 bit, here are a few links:
http://devresource.hp.com/STK/partner/3264interop.html (interoperability of 32- and 64-bit applications on 64-bit HP-UX)
http://devresource.hp.com/STK/srctransitions.html
http://devresource.hp.com/STK/hpux_faq.html

Cheryl
"Downtime is a Crime."
harry d brown jr
Honored Contributor

Re: 32bit and 64bit difference

it also refers to an additional 32 bits :-) Sorry, I just had to add that :-) I think I need a drink.

live free or die
harry
Live Free or Die
Max_4
Frequent Advisor

Re: 32bit and 64bit difference

Thanks to everybody, especially to Clay... He's been of great help...

With respect to the word size tradeoff,
How can I know the default word size in an architecture?

Thanks again to all...
Ramalingam
Advisor

Re: 32bit and 64bit difference

Hi ,
Thanks for your Query and for all other's reply ...

I think it is too late...
But hope this helps

For Default Word Length

getconf WORD_BIT

Regards,
Ram.
We Learn the most When We have to Invent