aarch64: Use UDOT for V8QI sad when dot product is available

On TARGET_DOTPROD targets the SAD can be lowered to two instructions:
UABD/SABD to compute the lane-wise absolute differences into a V8QI temporary
followed by a single UDOT against a vector of all-ones to widen and accumulate
the eight byte lanes into a V2SI result. The signed variant uses SABD but
still feeds UDOT since absolute differences are unsigned.

A new test sadv8qi-dotprod.c verifies that both unsigned and signed
SAD loops emit UABD/SABD + UDOT on arm_v8_2a_dotprod targets.

gcc/ChangeLog
	* config/aarch64/aarch64-simd.md: Add define_expand <su>sadv8qi
	guarded by TARGET_DOTPROD.

gcc/testsuite/ChangeLog
	* gcc.target/aarch64/sadv8qi-dotprod.c: New test.

Signed-off-by: Naveen <naveen.siddegowda@oss.qualcomm.com>
2 files changed