[EmitHLSCpp] Support PowFOp and ExtFOp

This commit is contained in:
Hanchen Ye 2022-04-19 22:52:40 -05:00
parent a0f19035cd
commit 8edd22a195
2 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,7 @@ public:
// Float binary expressions.
arith::CmpFOp, arith::AddFOp, arith::SubFOp, arith::MulFOp,
arith::DivFOp, arith::RemFOp, arith::MaxFOp, arith::MinFOp,
math::PowFOp,
// Integer binary expressions.
arith::CmpIOp, arith::AddIOp, arith::SubIOp, arith::MulIOp,
@ -175,6 +176,7 @@ public:
HANDLE(arith::RemFOp);
HANDLE(arith::MaxFOp);
HANDLE(arith::MinFOp);
HANDLE(math::PowFOp);
// Integer binary expressions.
HANDLE(arith::CmpIOp);

View File

@ -491,6 +491,7 @@ public:
bool visitOp(arith::RemFOp op) { return emitter.emitBinary(op, "%"), true; }
bool visitOp(arith::MaxFOp op) { return emitter.emitMaxMin(op, "max"), true; }
bool visitOp(arith::MinFOp op) { return emitter.emitMaxMin(op, "min"), true; }
bool visitOp(math::PowFOp op) { return emitter.emitMaxMin(op, "pow"), true; }
/// Integer binary expressions.
bool visitOp(arith::CmpIOp op);
@ -534,6 +535,7 @@ public:
bool visitOp(arith::TruncFOp op) { return emitter.emitAssign(op), true; }
bool visitOp(arith::ExtUIOp op) { return emitter.emitAssign(op), true; }
bool visitOp(arith::ExtSIOp op) { return emitter.emitAssign(op), true; }
bool visitOp(arith::ExtFOp op) { return emitter.emitAssign(op), true; }
private:
ModuleEmitter &emitter;