[Mlir-commits] [mlir] [mlir][tosa] Clarify signless integer type semantics (PR #234173)
Peng Sun
llvmlistbot at llvm.org
Wed Oct 21 05:07:20 PDT 2026
https://github.com/psunn created https://github.com/llvm/llvm-project/pull/234173
Update the comment. Explain that signless integers match the TOSA specification and use signed interpretation unless an operation specifies otherwise. Clarify that unsigned types and additional bit widths are dialect extensions, and point to strict validation for standard conformance.
>From 956a7e1377f970c360e74664979937402b8d5de8 Mon Sep 17 00:00:00 2001
From: Peng Sun <peng.sun at arm.com>
Date: Wed, 21 Oct 2026 13:00:05 +0100
Subject: [PATCH] [mlir][tosa] Clarify signless integer type semantics
---
mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
index 4d6727ed76c564..deb38ab7de2c3b 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
@@ -55,9 +55,10 @@ def Tosa_Int32 : I<32>;
def Tosa_Int64 : I<64>;
// The TOSA dialect allows more types than the TOSA standard to allow for
-// experimentation. For historical reasons, signless is used in the place of
-// signed.
-// The TosaValidation pass can be used to check for standard conformance.
+// experimentation.
+// TOSA integer values are signless and interpreted as signed two's-complement
+// unless an operation specifies otherwise.
+// Use TosaValidation with strict-op-spec-alignment to check standard conformance.
def Tosa_Int : AnyTypeOf<[AnyUnsignedInteger,
AnySignlessInteger]>;
More information about the Mlir-commits
mailing list