[llvm] [RISCV] Support P extension ABSW instruction. (PR #165047)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 08:47:42 PDT 2025


topperc wrote:

> Is there any reason we can't pattern match ISD::ABS -> absw, e.g. `def : PatGprGpr<binop_allwusers<abs>, ABSW>;`?

An i64 abs would use bit 63 as the sign bit. We need to use bit 31. Having all W users isn't enough.

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


More information about the llvm-commits mailing list