From d2f9536e92ebfbfbd62e4c71eac99ed2f8016ff0 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Wed, 30 Jul 2008 19:07:44 -0500 Subject: [PATCH] port Vector_Scale. --- include/cloog/ppl_backend.h | 11 ++++++++++- source/ppl/clast.c | 3 +-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/cloog/ppl_backend.h b/include/cloog/ppl_backend.h index de5c5f9..b19f394 100644 --- a/include/cloog/ppl_backend.h +++ b/include/cloog/ppl_backend.h @@ -542,7 +542,16 @@ typedef struct polyhedron1 { unsigned flags; } Polyhedron; -void Vector_Scale(Value *p1,Value *p2,Value lambda,unsigned length); +static inline void cloog_vector_scale (Value * p1, Value * p2, + Value x, + unsigned length) +{ + int i; + + for (i = 0; i < length; i++) + value_multiply (*p2++, *p1++, x); +} + void Vector_Combine(Value *p1, Value *p2, Value *p3, Value lambda, Value mu, unsigned length); Polyhedron *Constraints2Polyhedron(Matrix *Constraints,unsigned NbMaxRays); diff --git a/source/ppl/clast.c b/source/ppl/clast.c index b7948e4..60ee56e 100644 --- a/source/ppl/clast.c +++ b/source/ppl/clast.c @@ -994,7 +994,6 @@ static void Euclid(Value a, Value b, Value *x, Value *y, Value *g) value_clear(f); value_clear(tmp); } - /** * insert_modulo_guard: @@ -1032,7 +1031,7 @@ static void insert_modulo_guard(CloogMatrix *matrix, int num, int level, cloog_vector_copy(matrix->p[num]+1, line+1, len-1); else { value_set_si(val, -1); - Vector_Scale(matrix->p[num]+1, line+1, val, len-1); + cloog_vector_scale(matrix->p[num]+1, line+1, val, len-1); } value_oppose(line[level], line[level]); assert(value_pos_p(line[level])); -- 2.11.4.GIT