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.
Technology Stocks : Advanced Micro Devices - Moderated (AMD) -- Ignore unavailable to you. Want to Upgrade?


To: brushwud who wrote (87539)8/23/2002 3:59:03 PM
From: combjellyRead Replies (2) | Respond to of 275872
 
"There's no need to do that in the software, because 32-bit constants get padded out to 64 bits by the hardware."

Yeah, but too much code declares variables as type 'int'. Type 'int' will be 32 bits on a regular x86 compile and 64 bits on a x86-64 bit compile.

"the average instruction size goes up by a fraction of a byte, and is still less than 4 bytes. "

That's better than I would have expected. To keep compatible encodings, there are escape bytes and not particularly dense encodings for many of the new instructions. I guess they buy enough with the extra registers and not needing to move stuff around due to the more general purpose registers to reduce the actual number of instructions needed.



To: brushwud who wrote (87539)8/23/2002 7:46:11 PM
From: Joe NYCRead Replies (2) | Respond to of 275872
 
brushwud,

I am curious about this constant padding by hardware. (I apologize for my assembly skills being limited to one semester course on Vax-11).

Suppose you have a statement that says load 1 to register, say A. Your code can say that, but when the assembler generates executable code, it has to represent the number 1 as something, I mean a value stored in executable with some width. Doesn't the width have to be the size of the register you are loading?

I seem to recall that 386 has special instructions to load only low portion of a register. So if this instruction is used, you have loaded the low portion of the register, say only 8 or 16 bit representation of number one, but what happens to the high part of the register, especially if you want to use the number if full 32 or 64 bit operations?

Joe