Zum Inhalt der Seite gehen


On x86 there are unaligned and aligned move from/to memory instructions. The ISA guides say to use the aligned versions when operands are known to be aligned.

Is there any gain from actually doing that?

Unbekannter Ursprungsbeitrag

mastodon - Link zum Originalbeitrag
Laurent Bercot
I have no idea, it's just what I was told by people who know more about Intel CPUs than I do.
Unbekannter Ursprungsbeitrag

friendica (DFRN) - Link zum Originalbeitrag
elrido
@David Monniaux @Laurent Bercot I don't know either, but if I had to reproduce such an unaligned op in C code, using always 64bit-aligned memory access, I'd load the chunk the data is in, then shift the chunk so it starts with the requested address, before storing it in the desired register. That would be at least one extra step over just loading and storing data unchanged.