actually, can define the x86 sadbw-using vfold for i8

it's unsigned, but that doesn't matter when just taking the low 8 bits
This commit is contained in:
dzaima 2025-03-22 18:20:59 +02:00
parent 4e03a6310c
commit c7632c23a2

View File

@ -9,9 +9,9 @@ def vfold{F, x:V=[_]T if w128{V} and hasarch{'X86_64'}} = {
if (EW==8) { v:=extract{[8]i16~~c, 0}; F{cast_i{T, v}, cast_i{T, v>>8}} }
else extract{c, 0}
}
def vfold{(__add), x:V=([16]u8) if hasarch{'X86_64'}} = {
def vfold{(__add), x:V=[16]E if hasarch{'X86_64'} and width{E}==8} = {
c:= x + shuf{u64, x, 1,0}
cast_i{u8, extract{absdiff_sum{8, c, [16]u8**0}, 0}}
cast_i{E, extract{absdiff_sum{8, ty_u{c}, [16]u8**0}, 0}}
}