Instruction matrix

x86 SSE4, AVX2

Operations ⬇ Types ⮕i8u8i16u16i32u32i64u64f32f64
ARITHMETIC
add1111111111
sub1111111111
pairwise add9911119911
pairwise sub1911119911
saturated_add11119999
saturated_sub11119999
average21212222
shift left/right by constant bits22111111
bit-shift-right-var (independent lanes)99991191
bit-shift-left-var (independent lanes)99991111
abs111911
negate222211
min/max1111112311
mul_truncate (x86 mullo)99111199
mul_even (PPC mule)999911
mul_fp11
muladd_fp (3 variants with +/-)11
div_fp11
reciprocal_approx19
sqrt11
recip_sqrt_approx19
floor11
ceil11
round11
COMPARE
compare LT/GT1313131311
compare LE/GE2222222211
compare ==1111111111
compare !=2222222211
compare entire register to 01111111111
LOGICAL
and1111111111
and(not a, b)1111111111
or1111111111
xor1111111111
bitwise NOT2222222222
movmskb (concat high bit of each byte)1122111111
LOAD/STORE
load_aligned1111111111
load_unaligned1111111111
load_64_unaligned1111111111
load1_and_broadcast2222222211
store_aligned1111111111
store_unaligned1111111111
store64_unaligned1111111111
store_323333111111
stream (non-temporal write)9999111111
SWIZZLE
shift128 left/right by constant bytes11111111
Shift 2x128 bit right in byte increments1111111111
broadcast any lane9999111111
16-byte shuffle (var indices, >127 to zero)1111111111
Shuffle1032, 0321, 21031111111111
Interleave/zip = unpack1111111111
BlendV with full bit mask, not just MSB1111111111
CONVERSION
Expand to 2x width (u8->u16, f32->f64)1111111
Reducing to half width (e.g. u16->u8)1111991
Convert integer -> same size real1999
Convert real -> same size integer19
Extract lane 0 to reg/aligned mem1111111111
Insert reg/aligned mem into lane 01111111111
CRYPTO/HASH
SHA11
SHA2561
AES1
CRC32C1111
CLMUL1
EMULATED
mulhi161
horz_sum1

ppc (POWER 8/9) w/ VSX

Operations ⬇ Types ⮕i8u8i16u16i32u32i64u64f32f64
ARITHMETIC
add1111111111
sub1111111111
pairwise add9999999999
pairwise sub9999999999
saturated_add11111199
saturated_sub11111199
average11111188
shift left/right by constant bits22222222
bit-shift-right-var (independent lanes)11111111
bit-shift-left-var (independent lanes)11111111
abs333311
negate222211
min/max1111111111
mul_truncate (x86 mullo)11111111
mul_even (PPC mule)111111
mul_fp11
muladd_fp (3 variants with +/-)11
div_fp11
reciprocal_approx11
sqrt11
recip_sqrt_approx11
floor11
ceil11
round11
COMPARE
compare LT/GT1111111111
compare LE/GE1111111111
compare ==1111111111
compare !=2222222222
compare entire register to 01111111111
LOGICAL
and1111111111
and(not a, b)1111111111
or1111111111
xor1111111111
bitwise NOT2222222222
movmskb (concat high bit of each byte)3333333333
LOAD/STORE
load_aligned1111111111
load_unaligned1111111111
load_64_unaligned2222222222
load1_and_broadcast2222221111
store_aligned1111111111
store_unaligned1111111111
store64_unaligned2222222222
store_321111111111
stream (non-temporal write)1111111111
SWIZZLE
shift128 left/right by constant bytes11111111
Shift 2x128 bit right in byte increments1111111111
broadcast any lane9999111111
16-byte shuffle (var indices, >127 to zero)1111111111
Shuffle1032, 0321, 21031111111111
Interleave/zip = unpack1111111111
BlendV with full bit mask, not just MSB1111111111
CONVERSION
Expand to 2x width (u8->u16, f32->f64)1212121
Reducing to half width (e.g. u16->u8)1111111
Convert integer -> same size real1111
Convert real -> same size integer11
Extract lane 0 to reg/aligned mem1111111111
Insert reg/aligned mem into lane 01111111111
CRYPTO/HASH
SHA11
SHA2561
AES1
CRC32C3333
CLMUL1
EMULATED
mulhi1613
horz_sum5

Note: Loads/Stores may be big endian on PPC.

arm64 NEON

Operations ⬇ Types ⮕i8u8i16u16i32u32i64u64f32f64
ARITHMETIC
add1111111111
sub1111111111
pairwise add1111111111
pairwise sub9999999999
saturated_add11111111
saturated_sub11111111
average11111111
shift left/right by constant bits11111111
bit-shift-right-var (independent lanes)22222222
bit-shift-left-var (independent lanes)11111111
abs111111
negate111111
min/max1111111111
mul_truncate (x86 mullo)11111199
mul_even (PPC mule)222222
mul_fp11
muladd_fp (3 variants with +/-)11
div_fp11
reciprocal_approx11
sqrt11
recip_sqrt_approx11
floor11
ceil11
round11
COMPARE
compare LT/GT1111111111
compare LE/GE1111111111
compare ==1111111111
compare !=1111111111
compare entire register to 03333333333
LOGICAL
and1111111111
and(not a, b)1111111111
or1111111111
xor1111111111
bitwise NOT1111111111
movmskb (concat high bit of each byte)5555555555
LOAD/STORE
load_aligned1111111111
load_unaligned1111111111
load_64_unaligned1111111111
load1_and_broadcast1111111111
store_aligned1111111111
store_unaligned1111111111
store64_unaligned1111111111
store_321111111111
stream (non-temporal write)1111111111
SWIZZLE
shift128 left/right by constant bytes11111111
Shift 2x128 bit right in byte increments1111111111
broadcast any lane1111111111
16-byte shuffle (var indices, >127 to zero)1111111111
Shuffle1032, 0321, 21031111111111
Interleave/zip = unpack1111111111
BlendV with full bit mask, not just MSB1111111111
CONVERSION
Expand to 2x width (u8->u16, f32->f64)1111111
Reducing to half width (e.g. u16->u8)1111111
Convert integer -> same size real111111
Convert real -> same size integer11
Extract lane 0 to reg/aligned mem1111111111
Insert reg/aligned mem into lane 01111111111
CRYPTO/HASH
SHA11
SHA2561
AES1
CRC32C1111
CLMUL
EMULATED
mulhi162
horz_sum3

Intersection

Worst case instruction count.

Operations ⬇ Types ⮕i8u8i16u16i32u32i64u64f32f64
ARITHMETIC
add1111111111
sub1111111111
pairwise add9999999999
pairwise sub9999999999
saturated_add11119999
saturated_sub11119999
average21212288
shift left/right by constant bits22222222
bit-shift-right-var (independent lanes)99992292
bit-shift-left-var (independent lanes)99991111
abs333911
negate222211
min/max1111112311
mul_truncate (x86 mullo)99111199
mul_even (PPC mule)999922
mul_fp11
muladd_fp (3 variants with +/-)11
div_fp11
reciprocal_approx19
sqrt11
recip_sqrt_approx19
floor11
ceil11
round11
COMPARE
compare LT/GT1313131311
compare LE/GE2222222211
compare ==1111111111
compare !=2222222222
compare entire register to 03333333333
LOGICAL
and1111111111
and(not a, b)1111111111
or1111111111
xor1111111111
bitwise NOT2222222222
movmskb (concat high bit of each byte)5555555555
LOAD/STORE
load_aligned1111111111
load_unaligned1111111111
load_64_unaligned2222222222
load1_and_broadcast2222222211
store_aligned1111111111
store_unaligned1111111111
store64_unaligned2222222222
store_323333111111
stream (non-temporal write)9999111111
SWIZZLE
shift128 left/right by constant bytes11111111
Shift 2x128 bit right in byte increments1111111111
broadcast any lane9999111111
16-byte shuffle (var indices, >127 to zero)1111111111
Shuffle1032, 0321, 21031111111111
Interleave/zip = unpack1111111111
BlendV with full bit mask, not just MSB1111111111
CONVERSION
Expand to 2x width (u8->u16, f32->f64)1212121
Reducing to half width (e.g. u16->u8)1111991
Convert integer -> same size real9999
Convert real -> same size integer19
Extract lane 0 to reg/aligned mem1111111111
Insert reg/aligned mem into lane 01111111111
CRYPTO/HASH
SHA11
SHA2561
AES1
CRC32C3333
CLMUL
EMULATED
mulhi16
horz_sum