[Info-vax] x86-64 data alignment / faulting
Scott Dorsey
kludge at panix.com
Tue Mar 15 17:56:55 EDT 2022
John Dallman <jgd at cix.co.uk> 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).
This is true. And it's turned off because the performance penalty is not
too significant of one.
>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.
All you can do is throw cache at the problem and try to write code that
has good reference locality. Intel are experts at throwing cache at
problems, though.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."
More information about the Info-vax
mailing list