[clang] [llvm] [RISCV][P-ext] Support Packed Absolute Value and Absolute Difference (PR #203840)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 07:47:23 PDT 2026


================
@@ -92,6 +92,17 @@ typedef uint32_t uint32x2_t __attribute__((__vector_size__(8)));
     return (rty)(__rs1 op __rs2);                                              \
   }
 
+#define __packed_unary_builtin_cast(name, ty, rty, builtin)                    \
+  static __inline__ rty __DEFAULT_FN_ATTRS __riscv_##name(ty __rs1) {          \
+    return (rty)builtin(__rs1);                                                \
----------------
topperc wrote:

We can use __builtin_elementwise_abs here. My comment was only directed at the abd that required a DAG combine pattern match.

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


More information about the llvm-commits mailing list