[Mlir-commits] [mlir] [mlir][arith] Add nneg to extui and uitofp. (PR #183165)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Feb 25 06:41:53 PST 2026
================
@@ -1172,14 +1172,19 @@ def Arith_RemFOp : Arith_FloatBinaryOp<"remf"> {
// ExtUIOp
//===----------------------------------------------------------------------===//
-def Arith_ExtUIOp : Arith_IToICastOp<"extui"> {
+def Arith_ExtUIOp :
+ Arith_IToICastOp<"extui", [DeclareOpInterfaceMethods<ArithNonNegFlagInterface>]> {
let summary = "integer zero extension operation";
let description = [{
The integer zero extension operation takes an integer input of
width M and an integer destination type of width N. The destination
bit-width must be larger than the input bit-width (N > M).
The top-most (N - M) bits of the output are filled with zeros.
+ This op supports an `nneg` flag. If the flag is present, the operand
+ is known to be non-negative, i.e. the sign bit is zero. This allows
+ the zero extension to be treated as a sign extension.
----------------
kuhar wrote:
Maybe we can say `is assumed to have`. When this assumption is violated, the result is poison.
https://github.com/llvm/llvm-project/pull/183165
More information about the Mlir-commits
mailing list