std-simd
std-simd copied to clipboard
Reduce to a bigger type.
When reducing a SIMD data type containing, say, chars using addition, the resulting type is char, likely leading to overflows. Traditional solutions would use the SAD instructions (Sum of Absolute Differences) to do a partial sum into bigger types, then use a reduce on the bigger types.
I don't see the SAD functions used in the codebase, nor a way to ask for a different return type using reduce. Am I missing something? Is the standard offering that functionality?