From bb8f500a2af7a79feeb2aeb568e18e3a9aa64abe Mon Sep 17 00:00:00 2001 From: CblPOK-git Date: Fri, 6 Oct 2023 11:47:00 +0000 Subject: [PATCH] implement handler for assigner_exit_check intrinsic --- include/nil/blueprint/parser.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/nil/blueprint/parser.hpp b/include/nil/blueprint/parser.hpp index f6dff7e9..eb99b1e2 100644 --- a/include/nil/blueprint/parser.hpp +++ b/include/nil/blueprint/parser.hpp @@ -436,9 +436,20 @@ namespace nil { handle_curve_init(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( + 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!"); }