Murilo Gomes
Murilo Gomes

Reputation: 25

What is the relationship between "64-bit operating system", "x64-based processor" to word size?

I was wondering, does a 64-bit operating system and a x64-based processor mean that the word size (i.e. memory transfer size between processor and physical memory) is 64 bits? What if the operating system is a 32-bit and processor x64? And what about x86-based processors? How do these two specifications (XX-bit operating system and xXX-based processor) relate to the actual word size in the hardware?

Upvotes: 1

Views: 1195

Answers (1)

Peter Cordes
Peter Cordes

Reputation: 364088

No, it doesn't mean that. modern x86 CPUs have 64-byte cache lines, and can do accesses to cache at any power-of-2 width from 1 byte up to a 32 byte SIMD vector, or 64-byte in CPUs with AVX512. See also How much of ‘What Every Programmer Should Know About Memory’ is still valid?

"word size" is not really a meaningful term for x86; it's not a word-oriented ISA at all.

In Intel documentation a "word" is 16 bits, just to maintain consistency with documentation going back to 8086. The bus and register widths in hardware are unrelated to that.


x86-64 has 64-bit integer registers when running in long mode (64-bit mode). And supports 64-bit addresses. (Actually 48 bit virtual addresses, and up to 52-bit physical depending on the hardware, because of the page table format. Why in x86-64 the virtual address are 4 bits shorter than physical (48 bits vs. 52 long)?)

x86 CPUs since 32-bit Pentium have been able to do 64-bit data transfers. Why is integer assignment on a naturally aligned variable atomic on x86?


Related:

Upvotes: 5

Related Questions