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_pw_macro.h>
13 #define VAL CAT(isl_,VAL_BASE)
15 /* Add "v" to the constant term of "pw" over its entire definition domain.
17 __isl_give PW
*FN(FN(PW
,add_constant
),VAL_BASE
)(__isl_take PW
*pw
,
24 zero
= FN(VAL
,is_zero
)(v
);
25 n
= FN(PW
,n_piece
)(pw
);
26 if (zero
< 0 || n
< 0)
33 for (i
= 0; i
< n
; ++i
) {
36 el
= FN(PW
,take_base_at
)(pw
, i
);
37 el
= FN(FN(EL
,add_constant
),VAL_BASE
)(el
, FN(VAL
,copy
)(v
));
38 pw
= FN(PW
,restore_base_at
)(pw
, i
, el
);