4 ms·
like mentioned x86/64 is quite generous with non-aligned access, yet on architectures that require aligned loads, they will be aligned (all lowest bits being ze
by xxs 2y ago
like mentioned x86/64 is quite generous with non-aligned access, yet on architectures that require aligned loads, they will be aligned (all lowest bits being zero at the start), so it will continue being aligned with each 8 byte load.
- teo_zero 2y ago> they will be aligned (all lowest bits being zero at the start I don't think so. At the start k will be equal to keyIn, which can point to any arbitrary memory location.
- rerdavies 2y agoBut in practice, will always point to the start of a buffer allocated from the heap which will be aligned.
- teo_zero 2y agoWhy? If you are hashing names, for example, or keywords, they can begin at whatever position inside the buffer. The case where you allocate a buffer, populate it with random contents and hash the whole of it is an artificial setup for benchmarking, but far from real use cases.
- xxs 2y agoi was about to answer pretty much as 'rerdavies' did. If you have such requirements the specific architectures would need wrappers to copy the data, or do pref/post fix up (ala crc32 & avx implementations on non perfect boundary)