Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ghehg committed Oct 16, 2024
1 parent 51f1324 commit 98f5133
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1183,16 +1183,18 @@ def ShiftOp : CIR_Op<"shift", [Pure]> {
Shift `left` or `right`, according to the first operand. Second operand is
the shift target and the third the amount. Second and the thrid operand can
be either integer type or vector of integer type. However, they must be
either all vector of integer type, or all integer type.
either all vector of integer type, or all integer type. If they are vectors,
each vector element of the shift target is shifted by the corresponding
shift amount in the shift amount vector.

```mlir
%7 = cir.shift(left, %1 : !u64i, %4 : !s32i) -> !u64i
%8 = cir.shift(left, %2 : !cir.vector<!s32i x 2>, %3 : !cir.vector<!s32i x 2>) -> !cir.vector<!s32i x 2>
```
}];

let results = (outs CIR_AnyIntOrVecofInt:$result);
let arguments = (ins CIR_AnyIntOrVecofInt:$value, CIR_AnyIntOrVecofInt:$amount,
let results = (outs CIR_AnyIntOrVecOfInt:$result);
let arguments = (ins CIR_AnyIntOrVecOfInt:$value, CIR_AnyIntOrVecOfInt:$amount,
UnitAttr:$isShiftleft);

let assemblyFormat = [{
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/CIR/Dialect/IR/CIRTypes.td
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def IntegerVector : Type<
}

// Constraints
def CIR_AnyIntOrVecofInt: AnyTypeOf<[CIR_IntType, IntegerVector]>;
def CIR_AnyIntOrVecOfInt: AnyTypeOf<[CIR_IntType, IntegerVector]>;

// Pointer to Arrays
def ArrayPtr : Type<
Expand Down

0 comments on commit 98f5133

Please sign in to comment.