[Info-vax] x86-64 data alignment / faulting
Arne Vajhøj
arne at vajhoej.dk
Tue Mar 15 19:37:20 EDT 2022
On 3/15/2022 4:09 PM, John Dallman wrote:
> In article <pB2YJ.292172$zX2.209805 at fx12.ams4>,
> mark.daniel at wasd.vsm.com.au (Mark Daniel) wrote, quoting VSI:
>
>> "On X86, there is no such thing as an alignment fault nor is
>> there a performance penalty for accessing unaligned data."
>
> That's a bit over-simplified. On x86, alignment faults are implemented in
> the hardware, but can be turned off, and are invariably turned off on
> every operating system where I've looked at this (Windows, Linux, macOS).
>
>
> There certainly used to be performance penalties for accessing unaligned
> data. I don't see how they can be avoided for the cases where misaligned
> data means that a data structure has member(s) in an additional cache
> line, increasing cache pressure.
In certain scenarios (random access where data size vs
cache size has the wrong ratio) that should be able
to create some overhead.
But not like what can be seen on Alpha and Itanium. My
little test program showed a factor 300 impact
on Itanium.
Arne
More information about the Info-vax
mailing list