[Mlir-commits] [mlir] [mlir][tosa] Clarify signless integer type semantics (PR #234173)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Oct 21 05:07:59 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-mlir-tosa
Author: Peng Sun (psunn)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/234173.diff
1 Files Affected:
- (modified) mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td (+4-3)
``````````diff
diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
index 4d6727ed76c56..deb38ab7de2c3 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]>;
``````````
</details>
https://github.com/llvm/llvm-project/pull/234173
More information about the Mlir-commits
mailing list