[Mlir-commits] [mlir] [mlir][arith] doc updates for ub semantics, and int representations (PR #72932)

Jakub Kuderski llvmlistbot at llvm.org
Mon Nov 20 21:34:16 PST 2023


================
@@ -420,8 +430,8 @@ def Arith_DivSIOp : Arith_IntBinaryOp<"divsi", [ConditionallySpeculatable]> {
     Signed integer division. Rounds towards zero. Treats the leading bit as
     sign, i.e. `6 / -2 = -3`.
 
-    Note: the semantics of division by zero or signed division overflow (minimum
-    value divided by -1) is TBD; do NOT assume any specific behavior.
+    Divison by zero, or signed division overflow (minimum value divided by -1) 
----------------
kuhar wrote:

Maybe something like: 'The behavior is undefined when dividing by zero. The behavior is also undefined on overflow (e.g., signed minimum divided by -1). Note that for `vector` and `tensor` operands, division by zero / overflow on any of the elements leads to undefined behavior.'

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


More information about the Mlir-commits mailing list