SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Pastimes : G&K Investing for Curmudgeons

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: DownSouth who wrote (5567)8/29/2000 11:40:08 AM
From: FaultLine  Read Replies (1) of 22706
 
A word can be..

As you imply, the word size is usually the most natural integer bit-width for a particular architecture. On most modern 64-bit machines the most natural size for the integer, hence the word size, is 64-bits. When you get to this situation the word and long word (Big Word?) are often the same thing.

Any compiler for a particular machine could be written such that the bit-width for each data type can pretty much any size the designer wants. But the compiler will run much faster (and the resulting code too) if the code generator uses the obvious sizes offered by a platform's instruction set and hardware architecture. Each machine offers a certain set of containers and instructions to operate on them. If the compiler designer wants to play bit-width games, each of the unnatural data objects will need to be converted or otherwise manipulated on the fly to maintain compatibility with the underlying hardware system.

Even though C and C++ run on just about every architecture on the planet, you must be especially careful when porting integer values from one platform to another. A word is not a word is not a word. This is particularly true when you are doing any kind of "bit-banging (bit-masking, bit-shifting and the like) as opposed to word or long word arithmetic/logical calculations. As a simple example of this problem, suppose a word is 32-bits wide and a long is 64-bits wide. Now suppose you try to use the long container as the destination of a concatenated (end-to-end joining) pair of words. Well that is just flat-out going to fail when you move to an architecture where the compiler and architecture says that a word and long word are the same size.

-fl@thisisgettingriscy.edu
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext