Skip to content

Commit ab6827f

Browse files
committed
[mlir][spirv] Extract Atomic/Cast/Group op implementation. NFC.
Continue to work outlined in D155747 and split the main SPIR-V ops implementation file into a few smaller and quicker to compile files. This organization matches the op definition organizaion in `.td` files. In this patch, extract atomic, cast/conversion, and group op implementation into separate files. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D155777
1 parent 8dacf55 commit ab6827f

File tree

7 files changed

+1213
-1144
lines changed

7 files changed

+1213
-1144
lines changed

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def SPIRV_BitcastOp : SPIRV_Op<"Bitcast", [Pure]> {
5151

5252
If Result Type has a different number of components than Operand, the
5353
total number of bits in Result Type must equal the total number of bits
54-
in Operand. Let L be the type, either Result Type or Operands type,
54+
in Operand. Let L be the type, either Result Type or Operand's type,
5555
that has the larger number of components. Let S be the other type, with
5656
the smaller number of components. The number of components in L must be
5757
an integer multiple of the number of components in S. The first
@@ -335,17 +335,17 @@ def SPIRV_UConvertOp : SPIRV_CastOp<"UConvert",
335335

336336
def SPIRV_ConvertPtrToUOp : SPIRV_Op<"ConvertPtrToU", []> {
337337
let summary = [{
338-
Bit pattern-preserving conversion of a pointer to
338+
Bit pattern-preserving conversion of a pointer to
339339
an unsigned scalar integer of possibly different bit width.
340340
}];
341341

342342
let description = [{
343343
Result Type must be a scalar of integer type, whose Signedness operand is 0.
344344

345-
Pointer must be a physical pointer type. If the bit width of Pointer is
346-
smaller than that of Result Type, the conversion zero extends Pointer.
347-
If the bit width of Pointer is larger than that of Result Type,
348-
the conversion truncates Pointer.
345+
Pointer must be a physical pointer type. If the bit width of Pointer is
346+
smaller than that of Result Type, the conversion zero extends Pointer.
347+
If the bit width of Pointer is larger than that of Result Type,
348+
the conversion truncates Pointer.
349349

350350
For same bit width Pointer and Result Type, this is the same as OpBitcast.
351351

@@ -359,7 +359,7 @@ def SPIRV_ConvertPtrToUOp : SPIRV_Op<"ConvertPtrToU", []> {
359359
#### Example:
360360

361361
```mlir
362-
%1 = spirv.ConvertPtrToU %0 : !spirv.ptr<i32, Generic> to i32
362+
%1 = spirv.ConvertPtrToU %0 : !spirv.ptr<i32, Generic> to i32
363363
```
364364
}];
365365

@@ -390,18 +390,18 @@ def SPIRV_ConvertPtrToUOp : SPIRV_Op<"ConvertPtrToU", []> {
390390

391391
def SPIRV_ConvertUToPtrOp : SPIRV_Op<"ConvertUToPtr", [UnsignedOp]> {
392392
let summary = [{
393-
Bit pattern-preserving conversion of an unsigned scalar integer
393+
Bit pattern-preserving conversion of an unsigned scalar integer
394394
to a pointer.
395395
}];
396396

397397
let description = [{
398398
Result Type must be a physical pointer type.
399399

400-
Integer Value must be a scalar of integer type, whose Signedness
401-
operand is 0. If the bit width of Integer Value is smaller
400+
Integer Value must be a scalar of integer type, whose Signedness
401+
operand is 0. If the bit width of Integer Value is smaller
402402
than that of Result Type, the conversion zero extends Integer Value.
403-
If the bit width of Integer Value is larger than that of Result Type,
404-
the conversion truncates Integer Value.
403+
If the bit width of Integer Value is larger than that of Result Type,
404+
the conversion truncates Integer Value.
405405

406406
For same-width Integer Value and Result Type, this is the same as OpBitcast.
407407

@@ -415,7 +415,7 @@ def SPIRV_ConvertUToPtrOp : SPIRV_Op<"ConvertUToPtr", [UnsignedOp]> {
415415
#### Example:
416416

417417
```mlir
418-
%1 = spirv.ConvertUToPtr %0 : i32 to !spirv.ptr<i32, Generic>
418+
%1 = spirv.ConvertUToPtr %0 : i32 to !spirv.ptr<i32, Generic>
419419
```
420420
}];
421421

0 commit comments

Comments
 (0)