Memory alignment on a 32-bit Intel processor

后端 未结 5 1600
攒了一身酷
攒了一身酷 2020-12-01 10:06

Intel\'s 32-bit processors such as Pentium have 64-bit wide data bus and therefore fetch 8 bytes per access. Based on this, I\'m assuming that the physical addresses that th

5条回答
  •  醉梦人生
    2020-12-01 10:33

    Physical bus is 64bit wide ...multiple of 8 --> yes

    HOWEVER, there are two more factor to consider:

    1. Some x86 instruction set are byte addressed. Some are 32bit aligned (that's why you have 4 byte thing). But no (core) instruction are 64bits aligned. The CPU can handle misaligned data access.
    2. If you care about the performance, you should think about the cache line, not main memory. Cache lines are much wider.

提交回复
热议问题