4 ms·
> AFAIK until the switch to 64-bit architectures, int actually was the natural word size 32-bit int is still arguably the native word size on x64. 32-bit is th
by dataflow 3y ago
> AFAIK until the switch to 64-bit architectures, int actually was the natural word size
32-bit int is still arguably the native word size on x64. 32-bit is the fastest integer type there. 64-bit at the very least often consumes an extra prefix byte in the instruction. And that prefix is literally called an "extension" prefix... very much the opposite of native!
- Karellen 3y agoAren't 32-bit registers/operations also called "extensions" of their 16-bit counterparts on the x86 line, due to the ISA's 16-bit 8086/80286 lineage? So could one make the argument that a 16-bit int ought to be the native word size on x64?
- dataflow 3y agoNo. This isn't about dictionary pedantry. 16-bit is actually frequently more expensive than 32-bit on x86.
- bonzini 3y ago32-bit also often has the prefix byte (if one of the operands is r8-r15 or, for extending moves from 8-bit registers, r4-r15)