Skip to content

Avoid UB on completely misaligned pointers + improve alignment option…

the-very requested to merge bench_align into master

Created by: nemo-cpt

The completely misaligned pointers e.g. float* not divisible by 4 are cannot be safely dereferenced by C++ standard (because they may only originate from pointer conversions from char* and accessing such pointer is UB under C++ type aliasing rules). So we leave ability to benchmark unaligned accesses in SIMD sense (not divisible by 16 or 32 depending on SIMD registers in use), but prohibit cases where alignment is worse than natural for type requested (4 for floats, 8 for doubles).

Merge request reports