[Mlir-commits] [mlir] [mlir][arith] Add subui_extended op (PR #197376)

Arseniy Obolenskiy llvmlistbot at llvm.org
Wed May 13 06:40:02 PDT 2026


aobolensk wrote:

> For example, we had this RFC for addui_extended https://discourse.llvm.org/t/rfc-add-integer-add-with-carry-op-to-arith/64573/6 and this RFC for mului_extended: https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869 . I don't necessarily think an RFC is necessary to make progress here, but this needs some motivation to ground the work, IMO.

`subui_extended` closes the obvious gap and maps 1:1 to `llvm.usub.with.overflow` and `spirv.ISubBorrow` as I mentioned in the description. The conversions to LLVM and SPIR-V are planned to be added afterwards. Corresponding high level language operations are `usubBorrow` in GLSL and `usubb` in HLSL correspondingly.

Example in GLSL:
```glsl
uvec4 borrow;
uvec4 d = usubBorrow(x, y, borrow);
```

The motivation for the change is the same for `addui_extended` and `mului_extended` basically, for wide integer emulation and operations with wide ints, to be more precise. 

Does that make sense? 

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


More information about the Mlir-commits mailing list