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

Simon Camphausen llvmlistbot at llvm.org
Thu Feb 29 00:32:14 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,
----------------
simon-camp wrote:

Can you add a `printUnaryOperation` helper and call it from here and the logical not op.

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


More information about the Mlir-commits mailing list