@@ -2705,7 +2705,7 @@ class CIR_BitOpBase<string mnemonic, TypeConstraint operandTy>
27052705 let results = (outs operandTy:$result);
27062706
27072707 let assemblyFormat = [{
2708- `(` $input `:` type($input) `)` `:` type($result) attr-dict
2708+ $input `:` type($result) attr-dict
27092709 }];
27102710}
27112711
@@ -2714,20 +2714,20 @@ class CIR_BitZeroCountOpBase<string mnemonic, TypeConstraint operandTy>
27142714 let arguments = (ins operandTy:$input, UnitAttr:$poison_zero);
27152715
27162716 let assemblyFormat = [{
2717- `(` $input `:` type($input) `)` (`poison_zero` $poison_zero^)?
2717+ $input (`poison_zero` $poison_zero^)?
27182718 `:` type($result) attr-dict
27192719 }];
27202720}
27212721
2722- def BitClrsbOp : CIR_BitOpBase<"bit. clrsb", CIR_SIntOfWidths<[32, 64]>> {
2722+ def BitClrsbOp : CIR_BitOpBase<"clrsb", CIR_SIntOfWidths<[32, 64]>> {
27232723 let summary = "Get the number of leading redundant sign bits in the input";
27242724 let description = [{
27252725 Compute the number of leading redundant sign bits in the input integer.
27262726
27272727 The input integer must be a signed integer. The most significant bit of the
2728- input integer is the sign bit. The `cir.bit. clrsb` operation returns the
2729- number of consecutive bits following the sign bit that are identical to the
2730- sign bit.
2728+ input integer is the sign bit. The `cir.clrsb` operation returns the number
2729+ of consecutive bits following the sign bit that are identical to the sign
2730+ bit.
27312731
27322732 The bit width of the input integer must be either 32 or 64.
27332733
@@ -2738,24 +2738,23 @@ def BitClrsbOp : CIR_BitOpBase<"bit.clrsb", CIR_SIntOfWidths<[32, 64]>> {
27382738 %0 = cir.const #cir.int<3735928559> : !s32i
27392739 // %1 will be 1 because there is 1 bit following the most significant bit
27402740 // that is identical to it.
2741- %1 = cir.bit. clrsb(%0 : !s32i) : !s32i
2741+ %1 = cir.clrsb %0 : !s32i
27422742
27432743 // %2 = 1, 0b0000_0000_0000_0000_0000_0000_0000_0001
27442744 %2 = cir.const #cir.int<1> : !s32i
27452745 // %3 will be 30 because there are 30 consecutive bits following the sign
27462746 // bit that are identical to the sign bit.
2747- %3 = cir.bit. clrsb(%2 : !s32i) : !s32i
2747+ %3 = cir.clrsb %2 : !s32i
27482748 ```
27492749 }];
27502750}
27512751
2752- def BitClzOp : CIR_BitZeroCountOpBase<"bit.clz",
2753- CIR_UIntOfWidths<[16, 32, 64]>> {
2752+ def BitClzOp : CIR_BitZeroCountOpBase<"clz", CIR_UIntOfWidths<[16, 32, 64]>> {
27542753 let summary = "Get the number of leading 0-bits in the input";
27552754 let description = [{
27562755 Compute the number of leading 0-bits in the input.
27572756
2758- The input integer must be an unsigned integer. The `cir.bit. clz` operation
2757+ The input integer must be an unsigned integer. The `cir.clz` operation
27592758 returns the number of consecutive 0-bits at the most significant bit
27602759 position in the input.
27612760
@@ -2768,18 +2767,17 @@ def BitClzOp : CIR_BitZeroCountOpBase<"bit.clz",
27682767 // %0 = 0b0000_0000_0000_0000_0000_0000_0000_1000
27692768 %0 = cir.const #cir.int<8> : !u32i
27702769 // %1 will be 28
2771- %1 = cir.bit. clz(%0 : !u32i) poison_zero : !u32i
2770+ %1 = cir.clz %0 poison_zero : !u32i
27722771 ```
27732772 }];
27742773}
27752774
2776- def BitCtzOp : CIR_BitZeroCountOpBase<"bit.ctz",
2777- CIR_UIntOfWidths<[16, 32, 64]>> {
2775+ def BitCtzOp : CIR_BitZeroCountOpBase<"ctz", CIR_UIntOfWidths<[16, 32, 64]>> {
27782776 let summary = "Get the number of trailing 0-bits in the input";
27792777 let description = [{
27802778 Compute the number of trailing 0-bits in the input.
27812779
2782- The input integer must be an unsigned integer. The `cir.bit. ctz` operation
2780+ The input integer must be an unsigned integer. The `cir.ctz` operation
27832781 counts the number of consecutive 0-bits starting from the least significant
27842782 bit.
27852783
@@ -2792,12 +2790,12 @@ def BitCtzOp : CIR_BitZeroCountOpBase<"bit.ctz",
27922790 // %0 = 0b1000
27932791 %0 = cir.const #cir.int<8> : !u32i
27942792 // %1 will be 3
2795- %1 = cir.bit. ctz(%0 : !u32i) poison_zero : !u32i
2793+ %1 = cir.ctz %0 poison_zero : !u32i
27962794 ```
27972795 }];
27982796}
27992797
2800- def BitParityOp : CIR_BitOpBase<"bit. parity", CIR_UIntOfWidths<[32, 64]>> {
2798+ def BitParityOp : CIR_BitOpBase<"parity", CIR_UIntOfWidths<[32, 64]>> {
28012799 let summary = "Get the parity of input";
28022800 let description = [{
28032801 Compute the parity of the input. The parity of an integer is the number of
@@ -2811,13 +2809,12 @@ def BitParityOp : CIR_BitOpBase<"bit.parity", CIR_UIntOfWidths<[32, 64]>> {
28112809 // %0 = 0x0110_1000
28122810 %0 = cir.const #cir.int<104> : !u32i
28132811 // %1 will be 1 since there are three 1-bits in %0
2814- %1 = cir.bit. parity(%0 : !u32i) : !u32i
2812+ %1 = cir.parity %0 : !u32i
28152813 ```
28162814 }];
28172815}
28182816
2819- def BitPopcountOp : CIR_BitOpBase<"bit.popcnt",
2820- CIR_UIntOfWidths<[16, 32, 64]>> {
2817+ def BitPopcountOp : CIR_BitOpBase<"popcount", CIR_UIntOfWidths<[16, 32, 64]>> {
28212818 let summary = "Get the number of 1-bits in input";
28222819 let description = [{
28232820 Compute the number of 1-bits in the input.
@@ -2830,25 +2827,22 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt",
28302827 // %0 = 0x0110_1000
28312828 %0 = cir.const #cir.int<104> : !u32i
28322829 // %1 will be 3 since there are 3 1-bits in %0
2833- %1 = cir.bit.popcnt(%0 : !u32i) : !u32i
2830+ %1 = cir.popcount %0 : !u32i
28342831 ```
28352832 }];
28362833}
28372834
2838- def BitReverseOp : CIR_BitOpBase<"bit.reverse ",
2835+ def BitReverseOp : CIR_BitOpBase<"bitreverse ",
28392836 CIR_UIntOfWidths<[8, 16, 32, 64]>> {
28402837 let summary = "Reverse the bit pattern of the operand integer";
28412838 let description = [{
2842- The `cir.bit.reverse` operation reverses the bits of the operand integer.
2843- Its only argument must be of unsigned integer types of width 8, 16, 32, or
2844- 64.
2845-
2846- This operation covers the C/C++ builtin function `__builtin_bitreverse`.
2839+ The `cir.bitreverse` operation reverses the bits of the operand integer. Its
2840+ only argument must be of unsigned integer types of width 8, 16, 32, or 64.
28472841
28482842 Example:
28492843
28502844 ```mlir
2851- %1 = cir.bit.reverse(%0 : !u32i) : !u32i
2845+ %1 = cir.bitreverse %0 : !u32i
28522846 ```
28532847 }];
28542848}
@@ -2869,7 +2863,7 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap", CIR_UIntOfWidths<[16, 32, 64]>> {
28692863 %0 = cir.const #cir.int<305419896> : !u32i
28702864
28712865 // %1 should be 0x78563412
2872- %1 = cir.byte_swap(%0 : !u32i) : !u32i
2866+ %1 = cir.byte_swap %0 : !u32i
28732867 ```
28742868 }];
28752869}
0 commit comments