[Mlir-commits] [mlir] [mlir][EmitC] Add bitwise operators (PR #83387)

Marius Brehler llvmlistbot at llvm.org
Thu Feb 29 01:11:00 PST 2024


================
@@ -588,6 +588,53 @@ static LogicalResult printOperation(CppEmitter &emitter,
   return success();
 }
 
+static LogicalResult printOperation(CppEmitter &emitter,
+                                    emitc::BitwiseAndOp bitwiseAndOp) {
+  Operation *operation = bitwiseAndOp.getOperation();
+  return printBinaryOperation(emitter, operation, "&");
+}
+
+static LogicalResult
+printOperation(CppEmitter &emitter,
+               emitc::BitwiseLeftShiftOp bitwiseLeftShiftOp) {
+  Operation *operation = bitwiseLeftShiftOp.getOperation();
+  return printBinaryOperation(emitter, operation, "<<");
+}
+
+static LogicalResult printOperation(CppEmitter &emitter,
----------------
marbre wrote:

Yeah, already had this on the stack and had the intention to add is as follow up. Added it to this PR now and changed the description accordingly.

https://github.com/llvm/llvm-project/pull/83387


More information about the Mlir-commits mailing list