Skip to content

Commit

Permalink
implement handler for assigner_exit_check intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git authored and nkaskov committed Oct 10, 2023
1 parent 3d66f24 commit bb8f500
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions include/nil/blueprint/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,20 @@ namespace nil {
handle_curve_init<var, BlueprintFieldType>(inst, frame);
return true;
}
case llvm::Intrinsic::assigner_exit_check:
// TODO: implement

case llvm::Intrinsic::assigner_exit_check: {
const var &logical_statement = frame.scalars[inst->getOperand(0)];

std::size_t bitness = inst->getOperand(0)->getType()->getPrimitiveSizeInBits();

var comparison_result = handle_comparison_component<BlueprintFieldType, ArithmetizationParams>(
llvm::CmpInst::ICMP_EQ, logical_statement, zero_var, bitness,
bp, assignmnt, assignmnt.allocated_rows(), public_input_idx);

bp.add_copy_constraint({comparison_result, zero_var});

return true;
}
default:
UNREACHABLE("Unexpected intrinsic!");
}
Expand Down

0 comments on commit bb8f500

Please sign in to comment.