This is an archive of the discontinued LLVM Phabricator instance.

[mlir][emitc] Add div, mul and rem operators
ClosedPublic

Authored by marbre on Jul 10 2023, 7:13 AM.

Details

Summary

This adds operations for binary multiplicative arithmetic operators to
EmitC. The input and output arguments for the remainder operator are
restricted to index (emitted as size_t), integers and the EmitC opaque
types (as the operator can be overloaded for a custom type). The
multiplication and division operator further support floating point
numbers.

Diff Detail

Event Timeline

marbre created this revision.Jul 10 2023, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2023, 7:13 AM
marbre requested review of this revision.Jul 10 2023, 7:13 AM
jpienaar accepted this revision.Jul 11 2023, 9:49 AM

Looks good, similar to add .

mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
195

Nit: new line in between else I think markdown rendering won't work correctly.

This revision is now accepted and ready to land.Jul 11 2023, 9:49 AM
marbre marked an inline comment as done.Jul 11 2023, 11:39 PM

Thanks for your review @jpienaar!

mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
195

I just checked the already landed add op. There is no new line in between as well and markdown rendering works as expected.

This revision was automatically updated to reflect the committed changes.
marbre marked an inline comment as done.