Skip to content

Commit

Permalink
Add RZ_OWN/RZ_BORROW specs
Browse files Browse the repository at this point in the history
  • Loading branch information
pelijah committed Mar 30, 2024
1 parent 9347ade commit 0b5b20d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions librz/il/il_routines.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,46 +249,46 @@ static inline RZ_OWN RzILOpBool *_any_fl_is_nan(RZ_NONNULL RZ_OWN RzILOpFloat *x
return rz_il_op_new_bool_or(rz_il_op_new_is_nan(x), rz_il_op_new_is_nan(y));
}

static inline RZ_OWN RzILOpBool *_fl_is_less(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
static inline RZ_OWN RzILOpBool *_fl_is_less(RZ_NONNULL RZ_BORROW RzILOpFloat *x, RZ_NONNULL RZ_BORROW RzILOpFloat *y) {
RzILOpFloat *x_dup = rz_il_op_pure_dup(x);
RzILOpFloat *y_dup = rz_il_op_pure_dup(y);
return rz_il_op_new_forder(x_dup, y_dup);
}

RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fneq(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fneq(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y) {
rz_return_val_if_fail(x && y, NULL);
RzILOpBool *is_nan = _any_fl_is_nan(x, y);
RzILOpBool *not_equal = rz_il_op_new_bool_or(_fl_is_less(x, y), _fl_is_less(y, x));
return rz_il_op_new_bool_or(is_nan, not_equal);
}

RZ_API RZ_OWN RzILOpBool *rz_il_op_new_feq(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_feq(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y) {
rz_return_val_if_fail(x && y, NULL);
return rz_il_op_new_bool_inv(rz_il_op_new_fneq(x, y));
}

RZ_API RZ_OWN RzILOpBool *rz_il_op_new_flt(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_flt(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y) {
rz_return_val_if_fail(x && y, NULL);
RzILOpBool *not_nan = rz_il_op_new_bool_inv(_any_fl_is_nan(x, y));
RzILOpBool *is_less = _fl_is_less(x, y);
return rz_il_op_new_bool_and(not_nan, is_less);
}

RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fle(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fle(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y) {
rz_return_val_if_fail(x && y, NULL);
RzILOpBool *not_nan = rz_il_op_new_bool_inv(_any_fl_is_nan(x, y));
RzILOpBool *is_great = _fl_is_less(y, x);
return rz_il_op_new_bool_and(not_nan, rz_il_op_new_bool_inv(is_great));
}

RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fgt(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fgt(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y) {
rz_return_val_if_fail(x && y, NULL);
RzILOpBool *not_nan = rz_il_op_new_bool_inv(_any_fl_is_nan(x, y));
RzILOpBool *is_great = _fl_is_less(y, x);
return rz_il_op_new_bool_and(not_nan, is_great);
}

RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fge(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y) {
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fge(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y) {
rz_return_val_if_fail(x && y, NULL);
RzILOpBool *not_nan = rz_il_op_new_bool_inv(_any_fl_is_nan(x, y));
RzILOpBool *is_less = _fl_is_less(x, y);
Expand Down
12 changes: 6 additions & 6 deletions librz/include/rz_il/rz_il_opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,12 @@ RZ_API RZ_OWN RzILOpBitVector *rz_il_bswap16(RZ_BORROW RzILOpBitVector *t);
RZ_API RZ_OWN RzILOpBitVector *rz_il_bswap32(RZ_BORROW RzILOpBitVector *t);
RZ_API RZ_OWN RzILOpBitVector *rz_il_bswap64(RZ_BORROW RzILOpBitVector *t);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_ne(RZ_NONNULL RzILOpPure *x, RZ_NONNULL RzILOpPure *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fneq(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_feq(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_flt(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fle(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fgt(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fge(RZ_NONNULL RzILOpFloat *x, RZ_NONNULL RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fneq(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_feq(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_flt(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fle(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fgt(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y);
RZ_API RZ_OWN RzILOpBool *rz_il_op_new_fge(RZ_NONNULL RZ_OWN RzILOpFloat *x, RZ_NONNULL RZ_OWN RzILOpFloat *y);

///////////////////////////////
// Opcodes of type 'a effect //
Expand Down

0 comments on commit 0b5b20d

Please sign in to comment.