Skip to content

Commit

Permalink
Merge pull request #8 from AFLplusplus/upd
Browse files Browse the repository at this point in the history
Adding more functions
  • Loading branch information
tokatoka authored Oct 20, 2023
2 parents 6e1a055 + 5cb76f1 commit 6909c3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/rust_backend/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ DEF_BINARY_BV_EXPR_BUILDER(fp_rem)
#undef DEF_BINARY_BV_EXPR_BUILDER

DEF_UNARY_EXPR_BUILDER(fp_abs)
DEF_UNARY_EXPR_BUILDER(fp_neg)

DEF_UNARY_EXPR_BUILDER(not )
DEF_BINARY_BOOL_EXPR_BUILDER(not_equal)
Expand All @@ -227,6 +228,11 @@ DEF_BINARY_BOOL_EXPR_BUILDER(float_unordered_not_equal)

#undef DEF_BINARY_BOOL_EXPR_BUILDER

SymExpr _sym_build_ite(SymExpr cond, SymExpr a, SymExpr b) {
return registerExpression(symexpr(
_rsym_build_ite(symexpr_id(cond), symexpr_id(a), symexpr_id(b)), 0));
}

SymExpr _sym_build_sext(SymExpr expr, uint8_t bits) {
return registerExpression(symexpr(_rsym_build_sext(symexpr_id(expr), bits),
symexpr_width(expr) + bits));
Expand Down
2 changes: 2 additions & 0 deletions runtime/rust_backend/RustRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ RSymExpr _rsym_build_fp_mul(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_fp_div(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_fp_rem(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_fp_abs(RSymExpr a);
RSymExpr _rsym_build_fp_neg(RSymExpr a);

/*
* Boolean operations
Expand All @@ -87,6 +88,7 @@ RSymExpr _rsym_build_bool_or(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_or(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_bool_xor(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_xor(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_ite(RSymExpr cond, RSymExpr a, RSymExpr b);

RSymExpr _rsym_build_float_ordered_greater_than(RSymExpr a, RSymExpr b);
RSymExpr _rsym_build_float_ordered_greater_equal(RSymExpr a, RSymExpr b);
Expand Down

0 comments on commit 6909c3f

Please sign in to comment.