From 0055a8fb8c32e4e3ec0fb940b0f0b93516db58c1 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 24 Jun 2011 12:37:52 +0200 Subject: [PATCH] add isl_aff_scale_down_ui Signed-off-by: Sven Verdoolaege --- doc/user.pod | 2 ++ include/isl/aff.h | 1 + isl_aff.c | 15 +++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 94a216b..dce2a53 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2250,6 +2250,8 @@ Operations include isl_int f); __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f); + __isl_give isl_aff *isl_aff_scale_down_ui( + __isl_take isl_aff *aff, unsigned f); An expression can be printed using diff --git a/include/isl/aff.h b/include/isl/aff.h index c7933ae..16fb947 100644 --- a/include/isl/aff.h +++ b/include/isl/aff.h @@ -55,6 +55,7 @@ __isl_give isl_aff *isl_aff_sub(__isl_take isl_aff *aff1, __isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f); __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f); +__isl_give isl_aff *isl_aff_scale_down_ui(__isl_take isl_aff *aff, unsigned f); __isl_give isl_printer *isl_printer_print_aff(__isl_take isl_printer *p, __isl_keep isl_aff *aff); diff --git a/isl_aff.c b/isl_aff.c index 672c3d8..84f1fa4 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -589,3 +589,18 @@ __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f) return aff; } + +__isl_give isl_aff *isl_aff_scale_down_ui(__isl_take isl_aff *aff, unsigned f) +{ + isl_int v; + + if (f == 1) + return aff; + + isl_int_init(v); + isl_int_set_ui(v, f); + aff = isl_aff_scale_down(aff, v); + isl_int_clear(v); + + return aff; +} -- 2.7.4