Hi all, This is the first patch in a series to improve the RTL representation of the sum-of-absolute-differences patterns in the backend. We can use standard RTL codes and remove some unspecs. For UABDL and SABDL we have a widening of the result so we can represent uabdl (x, y) as (zero_extend (minus (smax (x, y) (smin (x, y))))) and sabdl (x, y) as (zero_extend (minus (umax (x, y) (umin (x, y))))). It is important to use zero_extend rather than sign_extend for the sabdl case, as the result of the absolute difference is still a positive unsigned value (the signedness of the operation refers to the values being diffed, not the absolute value of the difference) that must be zero-extended.
Bootstrapped and tested on aarch64-none-linux-gnu (these intrinsics are reasonably well-covered by the advsimd-intrinsics.exp tests) Pushing to trunk. Thanks, Kyrill gcc/ChangeLog: * config/aarch64/aarch64-simd.md (aarch64_<sur>abdl<mode>): Rename to... (aarch64_<su>abdl<mode>): ... This. Use standard RTL ops instead of unspec. * config/aarch64/aarch64.md (UNSPEC_SABDL, UNSPEC_UABDL): Delete. * config/aarch64/iterators.md (ABDL): Delete. (sur): Remove handling of UNSPEC_SABDL and UNSPEC_UABDL.
abdl.patch
Description: abdl.patch