Page MenuHomeFreeBSD
Paste P283

Clang 8.0.0 -O3 -msse -mavx -mavx2 -mssse3 -msse2, static inline variants
ActivePublic

Authored by cem on Thu, Aug 1, 3:09 PM.
When explicit -mavx etc are added, Clang generates vectorized ADDs as well:
(gdb) disas /m foo2
Dump of assembler code for function foo2:
23 return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == 0);
0x0000000000000054 <+4>: vpmovzxbd (%rdi),%xmm0
0x0000000000000059 <+9>: movzbl 0x4(%rdi),%eax
0x000000000000005d <+13>: vpshufd $0x4e,%xmm0,%xmm1
0x0000000000000062 <+18>: vpaddd %xmm0,%xmm1,%xmm0
0x0000000000000066 <+22>: vpshufd $0xe5,%xmm0,%xmm1
0x000000000000006b <+27>: vpaddd %xmm1,%xmm0,%xmm0
0x000000000000006f <+31>: vmovd %xmm0,%ecx
0x0000000000000073 <+35>: add %eax,%ecx
0x0000000000000075 <+37>: movzbl 0x5(%rdi),%edx
0x0000000000000079 <+41>: add %ecx,%edx

Event Timeline

cem created this paste.Thu, Aug 1, 3:09 PM
cem created this object in space S1 Global.