Vectorization examples

Luc Bourhis via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 24 07:13:37 PDT 2015


On Monday, 20 April 2015 at 11:15:48 UTC, finalpatch wrote:
> On Monday, 20 April 2015 at 11:01:28 UTC, Panke wrote:
>> Aren't unaligned loads as fast as aligned loads on modern x86?
>
> No that's not true. On modern x86 processors using unaligned 
> loading instructions on aligned data does not incur additional 
> overhead, therefore you can always use unaligned load for 
> everything, but loading unaligned data is still slower than 
> aligned data.

According to [1, section 7.13 and 8.13], the overhead was 
particularly bad for Core2 but this not a major issue either for 
Nehalem or SandyBridge anymore. Do you have data contradicting 
him?

[1] Agner Fog, 3. The microarchitecture of Intel, AMD and VIA 
CPUs, Tech. report, Copenhagen University College of Engineering, 
February 2012. http://www.agner.org/optimize/


More information about the Digitalmars-d mailing list