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

Hein RMS van den Heuvel heinvandenheuvel at gmail.com
Mon Feb 28 10:43:18 EST 2022


On Sunday, February 27, 2022 at 3:16:43 PM UTC-5, gah4 wrote:
:
> As well as I remember it, Alpha only has 32 bit and 64 bit aligned 
> load/store instructions. If you want something else, you do it with 
> some other instructions. Shifts and such. 
> 
> If the compiler does all that for you, it will be pretty slow. 

Pretty slow is subjective of course. but really it wasn't too bad imho.

As long as the compiler exactly what  to expect unaligned it fetched a larger aligned chunk,  mask and shift as needed and onwards. 

That was just a few clock cycles extra, MUCH less than the dozens of cycles the actual memory access would take.

If it had the check a suspect address it would be a bit longer.

Now if the compiler did not know or rather was mis-informed (about a dynamic data structure address) then an alignment trap would execute and thousands of instructions would execute some of them with system wide serialization. Ouch.

fwiw,
Hein.



More information about the Info-vax mailing list