[Mlir-commits] [mlir] [mlir][arith] Update documentation of shift Ops on allowed shift amounts (PR #82133)
Felix Schneider
llvmlistbot at llvm.org
Sat Feb 17 14:23:42 PST 2024
https://github.com/ubfx created https://github.com/llvm/llvm-project/pull/82133
This patch aligns the documentation of the shift Ops in `arith` with respective LLVM instructions. Specifically, it is now stated that shifting by an amount equal to the operand bitwidth returns poison.
>From d5dabc96a57974c3662aefe56ec29cddd40b7596 Mon Sep 17 00:00:00 2001
From: Felix Schneider <fx.schn at gmail.com>
Date: Sat, 17 Feb 2024 23:18:04 +0100
Subject: [PATCH] [mlir][arith] Update documentation of shift Ops on allowed
shift amounts
This patch aligns the documentation of the shift Ops in `arith` with
respective LLVM instructions. Specifically, it is now stated that
shifting by an amount equal to the operand bitwidth returns poison.
---
mlir/include/mlir/Dialect/Arith/IR/ArithOps.td | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mlir/include/mlir/Dialect/Arith/IR/ArithOps.td b/mlir/include/mlir/Dialect/Arith/IR/ArithOps.td
index 4babbe80e285f7..c9df50d0395d1f 100644
--- a/mlir/include/mlir/Dialect/Arith/IR/ArithOps.td
+++ b/mlir/include/mlir/Dialect/Arith/IR/ArithOps.td
@@ -788,7 +788,7 @@ def Arith_ShLIOp : Arith_IntBinaryOpWithOverflowFlags<"shli"> {
The `shli` operation shifts the integer value of the first operand to the left
by the integer value of the second operand. The second operand is interpreted as
unsigned. The low order bits are filled with zeros. If the value of the second
- operand is greater than the bitwidth of the first operand, then the
+ operand is greater or equal than the bitwidth of the first operand, then the
operation returns poison.
This op supports `nuw`/`nsw` overflow flags which stands stand for
@@ -818,8 +818,8 @@ def Arith_ShRUIOp : Arith_TotalIntBinaryOp<"shrui"> {
The `shrui` operation shifts an integer value of the first operand to the right
by the value of the second operand. The first operand is interpreted as unsigned,
and the second operand is interpreted as unsigned. The high order bits are always
- filled with zeros. If the value of the second operand is greater than the bitwidth
- of the first operand, then the operation returns poison.
+ filled with zeros. If the value of the second operand is greater or equal than the
+ bitwidth of the first operand, then the operation returns poison.
Example:
@@ -844,8 +844,8 @@ def Arith_ShRSIOp : Arith_TotalIntBinaryOp<"shrsi"> {
and the second operand is interpreter as unsigned. The high order bits in the
output are filled with copies of the most-significant bit of the shifted value
(which means that the sign of the value is preserved). If the value of the second
- operand is greater than bitwidth of the first operand, then the operation returns
- poison.
+ operand is greater or equal than bitwidth of the first operand, then the operation
+ returns poison.
Example:
More information about the Mlir-commits
mailing list