[llvm] [AArch64][GlobalISel] Added support for hadd family of intrinsics (PR #163985)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 09:21:58 PST 2025


================
@@ -511,6 +511,19 @@ Compute the absolute difference (signed and unsigned), e.g. trunc(abs(ext(x)-ext
   %0:_(s33) = G_ABDS %2, %3
   %1:_(s33) = G_ABDU %4, %5
 
+G_UAVGFLOOR, G_UAVGCEIL, G_SAVGFLOOR, G_SAVGCEIL
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Computes the average of corresponding elements in two vectors (signed and unsigned).
+Resulting vector contains values that are either rounded or truncated. e.g. trunc(shr(ext(a)+ext(b))).
----------------
davemgreen wrote:

trunc(shr(add(ext(a),ext(b)),1))

https://github.com/llvm/llvm-project/pull/163985


More information about the llvm-commits mailing list