[llvm] [RISCV][GISel] Lower G_ABDS and G_ABDU (PR #155888)

Shaoce SUN via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 09:15:17 PDT 2025


sunshaoce wrote:

> 
> It does work, but if we don't have Zbb, I think SelectionDAG uses this for scalars:
> 
> ```
>   // abds(lhs, rhs) -> select(sgt(lhs,rhs), sub(lhs,rhs), sub(rhs,lhs))          
>   // abdu(lhs, rhs) -> select(ugt(lhs,rhs), sub(lhs,rhs), sub(rhs,lhs)) 
> ```

Thank you very much @topperc for your detailed comments. I have updated the patch accordingly.

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


More information about the llvm-commits mailing list