AVX supports unaligned memory operands which makes the SATD code a bit denser.
%if %6 ; %5 aligned?
mova %1, %4
psubw %1, %5
+%elif cpuflag(avx)
+ movu %1, %4
+ psubw %1, %5
%else
movu %1, %4
movu %2, %5
psubw %1, %2
%endif
%else ; !HIGH_BIT_DEPTH
-%ifidn %3, none
movh %1, %4
movh %2, %5
+%ifidn %3, none
punpcklbw %1, %2
punpcklbw %2, %2
- psubw %1, %2
%else
- movh %1, %4
punpcklbw %1, %3
- movh %2, %5
punpcklbw %2, %3
- psubw %1, %2
%endif
+ psubw %1, %2
%endif ; HIGH_BIT_DEPTH
%endmacro