Skip to content

Commit

Permalink
update with new BigInt operation names
Browse files Browse the repository at this point in the history
  • Loading branch information
mars-risc0 committed Oct 23, 2024
1 parent 6ae253c commit 208ec1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions zirgen/Dialect/BigInt/Bytecode/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ size_t getCarryBytes(const Type& type) {
return 4;
}

std::vector<BytePoly> eqz(const BytePoly &poly, const Type &type) {
std::vector<BytePoly> eqz(const BytePoly& poly, const Type& type) {
if (toBQInt(poly) != 0) {
throw std::runtime_error("NONZERO");
}
Expand Down Expand Up @@ -290,7 +290,7 @@ EvalOutput eval(const Program& inFunc, std::vector<BQInt>& witnessValues) {
auto poly = polys[op.operandA];
const Type& type = inFunc.types[op.type];
auto carryPolys = eqz(poly, type);
for (auto &p: carryPolys) {
for (auto& p : carryPolys) {
ret.privateWitness.push_back(p);
}
} break;
Expand Down
4 changes: 2 additions & 2 deletions zirgen/Dialect/BigInt/Bytecode/mlir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ std::unique_ptr<Program> encode(mlir::func::FuncOp func) {
size_t type = builder.lookup(origOp.getResultTypes()[0]);
builder.emitBin(Op::Quo, type, op.getLhs(), op.getRhs());
})
.Case<NondetInvModOp>([&](auto op) {
.Case<NondetInvOp>([&](auto op) {
size_t type = builder.lookup(origOp.getResultTypes()[0]);
builder.emitBin(Op::Inv, type, op.getLhs(), op.getRhs());
})
Expand All @@ -176,7 +176,7 @@ std::unique_ptr<Program> encode(mlir::func::FuncOp func) {
newOp.operandA = builder.lookup(*op.getIn().getDefiningOp());
builder.emit(newOp);
})
.Case<ModularInvOp>([&](auto op) {
.Case<InvOp>([&](auto op) {
llvm::errs() << *op << "\n";
throw std::runtime_error("Cannot write ModularInvOp; use lower-modular-inv pass");
})
Expand Down

0 comments on commit 208ec1a

Please sign in to comment.