flat assembler
Message board for the users of flat assembler.
Index
> Main > unaligned small data loading in a register |
| Author |
|
|
sylware 15 Nov 2026, 14:06
Should I byte-load this data, or go bigger loads (short, dword) but unaligned?
(on modern µarchitectures) |
|||
|
|
bitRAKE 15 Nov 2026, 17:47
bitRAKE wrote: If the data is already in the cache this can be a small cost indeed. So, the next question we should ask, "Is the load predictable?" Code: tier cycles L1 3 - 5 L2 10 - 15 L3 30 - 70 mem 150 - 300 TLB 800 (miss) |
|||
|
|
sylware 15 Nov 2026, 22:42
Let's presume the data is in one L1 cache line, but unaligned.
Byte loading with many instructions or less instructions but with unaligned big loads? EDIT: it seems there is near 0 penalty, namely would mean it is better to use less machine instructions hence unaligned big memory loads. But it is obviously a machine instruction which becomes "heavy/complicated" the second you cross a cache line boundary in big loads. I rather not use that feature/optimization from a µarchitecture unless in some hardware specific super hardcore hot loops. |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.