@@ -195,6 +195,12 @@ def Arith_ConstantOp : Op<Arith_Dialect, "constant",
195
195
def Arith_AddIOp : Arith_TotalIntBinaryOp<"addi", [Commutative]> {
196
196
let summary = "integer addition operation";
197
197
let description = [{
198
+ Performs N-bit addition on the operands. The operands are interpreted as
199
+ unsigned bitvectors. The result is represented by a bitvector containing the
200
+ mathematical value of the addition modulo 2^n, where `n` is the bitwidth.
201
+ Because `arith` integers use a two's complement representation, this operation
202
+ is applicable on both signed and unsigned integer operands.
203
+
198
204
The `addi` operation takes two operands and returns one result, each of
199
205
these is required to be the same type. This type may be an integer scalar type,
200
206
a vector whose element type is integer, or a tensor of integers. It has no
@@ -230,7 +236,7 @@ def Arith_AddUIExtendedOp : Arith_Op<"addui_extended", [Pure, Commutative,
230
236
let description = [{
231
237
Performs (N+1)-bit addition on zero-extended operands. Returns two results:
232
238
the N-bit sum (same type as both operands), and the overflow bit
233
- (boolean-like), where`1` indicates unsigned addition overflow, while `0`
239
+ (boolean-like), where `1` indicates unsigned addition overflow, while `0`
234
240
indicates no overflow.
235
241
236
242
Example:
@@ -276,6 +282,18 @@ def Arith_SubIOp : Arith_TotalIntBinaryOp<"subi"> {
276
282
let summary = [{
277
283
Integer subtraction operation.
278
284
}];
285
+ let description = [{
286
+ Performs N-bit subtraction on the operands. The operands are interpreted as unsigned
287
+ bitvectors. The result is represented by a bitvector containing the mathematical
288
+ value of the subtraction modulo 2^n, where `n` is the bitwidth. Because `arith`
289
+ integers use a two's complement representation, this operation is applicable on
290
+ both signed and unsigned integer operands.
291
+
292
+ The `subi` operation takes two operands and returns one result, each of
293
+ these is required to be the same type. This type may be an integer scalar type,
294
+ a vector whose element type is integer, or a tensor of integers. It has no
295
+ standard attributes.
296
+ }];
279
297
let hasFolder = 1;
280
298
let hasCanonicalizer = 1;
281
299
}
@@ -288,6 +306,18 @@ def Arith_MulIOp : Arith_TotalIntBinaryOp<"muli", [Commutative]> {
288
306
let summary = [{
289
307
Integer multiplication operation.
290
308
}];
309
+ let description = [{
310
+ Performs N-bit multiplication on the operands. The operands are interpreted as
311
+ unsigned bitvectors. The result is represented by a bitvector containing the
312
+ mathematical value of the multiplication modulo 2^n, where `n` is the bitwidth.
313
+ Because `arith` integers use a two's complement representation, this operation is
314
+ applicable on both signed and unsigned integer operands.
315
+
316
+ The `muli` operation takes two operands and returns one result, each of
317
+ these is required to be the same type. This type may be an integer scalar type,
318
+ a vector whose element type is integer, or a tensor of integers. It has no
319
+ standard attributes.
320
+ }];
291
321
let hasFolder = 1;
292
322
let hasCanonicalizer = 1;
293
323
}
0 commit comments