2 * Copyright 2019 Cerebras Systems
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
10 #include <isl_multi_macro.h>
12 /* Add "v" to the constant terms of all the base expressions of "multi".
14 __isl_give
MULTI(BASE
) *FN(MULTI(BASE
),add_constant_val
)(
15 __isl_take
MULTI(BASE
) *multi
, __isl_take isl_val
*v
)
19 zero
= isl_val_is_zero(v
);
27 return FN(MULTI(BASE
),fn_val
)(multi
, &FN(EL
,add_constant_val
), v
);
29 FN(MULTI(BASE
),free
)(multi
);
34 /* Add the elements of "mv" to the constant terms of
35 * the corresponding base expressions of "multi".
37 __isl_give
MULTI(BASE
) *FN(MULTI(BASE
),add_constant_multi_val
)(
38 __isl_take
MULTI(BASE
) *multi
, __isl_take isl_multi_val
*mv
)
42 zero
= isl_multi_val_is_zero(mv
);
46 isl_multi_val_free(mv
);
50 return FN(MULTI(BASE
),fn_multi_val
)(multi
, &FN(EL
,add_constant_val
),
54 FN(MULTI(BASE
),free
)(multi
);
55 isl_multi_val_free(mv
);