[Info-vax] x86-64 data alignment / faulting

Michael S already5chosen at yahoo.com
Fri Mar 18 09:13:59 EDT 2022


On Tuesday, March 15, 2022 at 10:10:52 PM UTC+2, John Dallman wrote:
> In article <pB2YJ.292172$zX2.2... at fx12.ams4>, 
> mark.... 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). 
> 

That's not 100% correct.
On Intel hardware (as opposed to AMD's) for SSEn instructions (as opposed to Integer and AVX) alignment faults can't be turned off.
Naturally,  it does not apply to SSEn instructions that are called 'unaligned load' and 'unaligned store' .

> 
> 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. 
> 

Relatively recent measurements:
https://www.realworldtech.com/forum/?threadid=203203&curpostid=203232
And the rest of the sub-thread. Especially
https://www.realworldtech.com/forum/?threadid=203203&curpostid=203263


> 
> John



More information about the Info-vax mailing list