[llvm] [RISCV][XCV] Add LLVM intrinsics and patterns for XCVsimd (PR #204880)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 02:57:20 PDT 2026


VittorioBurani wrote:

Update: reworked per @lenary's point on intrinsics vs IR types.

The element-wise XCVsimd operations no longer use dedicated intrinsics. `2 x i16` and `4 x i8` are now legal GPR-resident types under XCVsimd (RV32), modeled the same way as the P extension, so plain vector IR selects the SIMD instructions:
- add/sub to cv.add/sub.h/.b
- smin/umin/smax/umax to cv.min/minu/max/maxu.h/.b
- abs to cv.abs.h/.b
- and/or/xor reuse the scalar AND/OR/XOR (lane-agnostic)

The corresponding full-vector intrinsics are removed. The scalar-broadcast (sc/sci) forms keep their intrinsics for now.

Still intrinsics, pending semantic confirmation against the CV32E40P spec: shifts (per-lane vs scalar amount), avg (rounding), and the comparisons (mask/sext). I will convert those in a follow-up.

New codegen test: `llvm/test/CodeGen/RISCV/xcvsimd-vector.ll`.


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


More information about the llvm-commits mailing list