From bc5b185358fe057877c3d70237c2fd97ef50be7c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 18 Mar 2010 14:24:09 +0100 Subject: [PATCH] iscc: add gist operations --- doc/isl.tex | 16 ++++++++++++++++ iscc.c | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/doc/isl.tex b/doc/isl.tex index 5eae623..6df7f93 100644 --- a/doc/isl.tex +++ b/doc/isl.tex @@ -172,6 +172,22 @@ of the set $s$ and return a piecewise quasipolynomial mapping each of the individual elements to the resulting constant \\ +$s_3$ := $s_1$ \ai[\tt]{\%} $s_2$ & +simplify $s_1$ in the context of $s_2$, i.e., compute +the gist of $s_1$ given $s_2$ +\\ +$m_3$ := $m_1$ \ai[\tt]{\%} $m_2$ & +simplify $m_1$ in the context of $m_2$, i.e., compute +the gist of $m_1$ given $m_2$ +\\ +$q_2$ := $q_1$ \ai[\tt]{\%} $s$ & +simplify $q_1$ in the context of the domain $s$, i.e., compute +the gist of $q_1$ given $s$ +\\ +$f_2$ := $f_1$ \ai[\tt]{\%} $s$ & +simplify $f_1$ in the context of the domain $s$, i.e., compute +the gist of $f_1$ given $s$ +\\ $m_2$ := $m_1$\ai[\tt]{\^{}-1} & inverse of $m_1$ \\ $l$ := $m$\ai[\tt]{\^{}+} & diff --git a/iscc.c b/iscc.c index 5a12a0b..2f96d83 100644 --- a/iscc.c +++ b/iscc.c @@ -192,6 +192,18 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fold_at( return at.res; } +static __isl_give isl_set *set_gist(__isl_take isl_set *set, + __isl_take isl_set *context) +{ + return isl_set_gist(set, isl_set_convex_hull(context)); +} + +static __isl_give isl_map *map_gist(__isl_take isl_map *map, + __isl_take isl_map *context) +{ + return isl_map_gist(map, isl_map_convex_hull(context)); +} + struct isc_bin_op bin_ops[] = { { '+', isl_obj_set, isl_obj_set, isl_obj_set, @@ -260,6 +272,18 @@ struct isc_bin_op bin_ops[] = { { '@', isl_obj_pw_qpolynomial_fold, isl_obj_set, isl_obj_pw_qpolynomial, (isc_bin_op_fn) &isl_pw_qpolynomial_fold_at }, + { '%', isl_obj_set, isl_obj_set, + isl_obj_set, + (isc_bin_op_fn) &set_gist }, + { '%', isl_obj_map, isl_obj_map, + isl_obj_map, + (isc_bin_op_fn) &map_gist }, + { '%', isl_obj_pw_qpolynomial, isl_obj_set, + isl_obj_pw_qpolynomial, + (isc_bin_op_fn) &isl_pw_qpolynomial_gist }, + { '%', isl_obj_pw_qpolynomial_fold, isl_obj_set, + isl_obj_pw_qpolynomial_fold, + (isc_bin_op_fn) &isl_pw_qpolynomial_fold_gist }, 0 }; -- 2.11.4.GIT