PIPS
arithmetique-local.h File Reference
#include <stdio.h>
#include <limits.h>
#include "boolean.h"
#include "arithmetic_errors.h"
+ Include dependency graph for arithmetique-local.h:

Go to the source code of this file.

Data Structures

struct  frac
 
struct  col
 

Macros

#define CURRENT_FUNCTION   "<unknown>"
 package arithmetique More...
 
#define PUSH_TIMEOUT_ENV(env)    push_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__)
 
#define POP_TIMEOUT_ENV(env)    pop_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__)
 
#define PUSH_TIMEOUT(delay)    push_timeout(delay, CURRENT_FUNCTION, __FILE__, __LINE__)
 
#define POP_TIMEOUT()    pop_timeout(CURRENT_FUNCTION, __FILE__, __LINE__)
 
#define __LONG_LONG_MAX__   9223372036854775807LL
 put there because I cannot have these constants with ansi options. More...
 
#define LONG_LONG_MAX   __LONG_LONG_MAX__
 
#define LONG_LONG_MIN   (-LONG_LONG_MAX-1)
 
#define ULONG_LONG_MAX   (LONG_LONG_MAX * 2ULL + 1)
 
#define LINEAR_VALUE_STRING   "int"
 default: LINEAR_VALUE_IS_INT More...
 
#define VALUE_FMT   "%d"
 
#define VALUE_CONST(val)   (val)
 
#define VALUE_NAN   INT_MIN
 
#define VALUE_MIN   (INT_MIN+1)
 
#define VALUE_MAX   INT_MAX
 
#define VALUE_ZERO   0
 
#define VALUE_ONE   1
 
#define VALUE_MONE   -1
 
#define VALUE_TO_LONG(val)   ((long)(val))
 
#define VALUE_TO_INT(val)   ((int)(val))
 
#define VALUE_TO_FLOAT(val)   ((float)(val))
 
#define VALUE_TO_DOUBLE(val)   ((double)(val))
 
#define int_to_value(i)   ((Value)(i))
 end LINEAR_VALUE_IS_INT More...
 
#define long_to_value(l)   ((Value)(l))
 
#define float_to_value(f)   ((Value)(f))
 
#define double_to_value(d)   ((Value)(d))
 
#define value_eq(v1, v2)   ((v1)==(v2))
 bool operators on values More...
 
#define value_ne(v1, v2)   ((v1)!=(v2))
 
#define value_gt(v1, v2)   ((v1)>(v2))
 
#define value_ge(v1, v2)   ((v1)>=(v2))
 
#define value_lt(v1, v2)   ((v1)<(v2))
 
#define value_le(v1, v2)   ((v1)<=(v2))
 
#define value_sign(v)   (value_eq(v,VALUE_ZERO)?0:value_lt(v,VALUE_ZERO)?-1:1)
 trian operators on values More...
 
#define value_compare(v1, v2)   (value_eq(v1,v2)?0:value_lt(v1,v2)?-1:1)
 
#define value_plus(v1, v2)   ((v1)+(v2))
 binary operators on values More...
 
#define value_div(v1, v2)   ((v1)/(v2))
 
#define value_mod(v1, v2)   ((v1)%(v2))
 
#define value_direct_multiply(v1, v2)   ((v1)*(v2)) /**direct! */
 
#define value_minus(v1, v2)   ((v1)-(v2))
 
#define value_pdiv(v1, v2)   (divide(v1,v2))
 
#define value_pmod(v1, v2)   (modulo(v1,v2))
 
#define value_min(v1, v2)   (value_le(v1,v2)? (v1): (v2))
 
#define value_max(v1, v2)   (value_ge(v1,v2)? (v1): (v2))
 
#define value_or(v1, v2)   ((v1)|(v2))
 
#define value_and(v1, v2)   ((v1)&(v2))
 
#define value_lshift(v1, v2)   ((v1)<<(v2))
 
#define value_rshift(v1, v2)   ((v1)>>(v2))
 
#define value_assign(ref, val)   (ref=(val))
 assigments More...
 
#define value_addto(ref, val)   (ref+=(val))
 
#define value_increment(ref)   (ref++)
 
#define value_direct_product(ref, val)   (ref*=(val)) /**direct! */
 
#define value_multiply(ref, val)   value_assign(ref,value_mult(ref,val))
 
#define value_substract(ref, val)   (ref-=(val))
 
#define value_decrement(ref)   (ref--)
 
#define value_division(ref, val)   (ref/=(val))
 
#define value_modulus(ref, val)   (ref%=(val))
 
#define value_pdivision(ref, val)   value_assign(ref,value_pdiv(ref,val))
 
#define value_oppose(ref)   value_assign(ref,value_uminus(ref))
 
#define value_absolute(ref)   value_assign(ref,value_abs(ref))
 
#define value_minimum(ref, val)   value_assign(ref,value_min(ref,val))
 
#define value_maximum(ref, val)   value_assign(ref,value_max(ref,val))
 
#define value_orto(ref, val)   (ref |= (val))
 
#define value_andto(ref, val)   (ref &= (val))
 
#define value_uminus(val)   (-(val))
 unary operators on values More...
 
#define value_not(val)   (~(val))
 
#define value_abs(val)
 
#define value_pos_p(val)   value_gt(val,VALUE_ZERO)
 
#define value_neg_p(val)   value_lt(val,VALUE_ZERO)
 
#define value_posz_p(val)   value_ge(val,VALUE_ZERO)
 
#define value_negz_p(val)   value_le(val,VALUE_ZERO)
 
#define value_zero_p(val)   value_eq(val,VALUE_ZERO)
 
#define value_notzero_p(val)   value_ne(val,VALUE_ZERO)
 
#define value_one_p(val)   value_eq(val,VALUE_ONE)
 
#define value_notone_p(val)   value_ne(val,VALUE_ONE)
 
#define value_mone_p(val)   value_eq(val,VALUE_MONE)
 
#define value_notmone_p(val)   value_ne(val,VALUE_MONE)
 
#define value_min_p(val)   value_eq(val,VALUE_MIN)
 
#define value_max_p(val)   value_eq(val,VALUE_MAX)
 
#define value_notmin_p(val)   value_ne(val,VALUE_MIN)
 
#define value_notmax_p(val)   value_ne(val,VALUE_MAX)
 
#define value_protected_hard_idiv_multiply(v, w, throw)
 (|v| < MAX / |w|) => v*w is okay I could check ((v*w)/w)==v but a tmp would be useful More...
 
#define value_protected_multiply(v, w, throw)    value_protected_hard_idiv_multiply(v,w,throw)
 is a software idiv is assumed, quick check performed first More...
 
#define value_protected_mult(v, w)    value_protected_multiply(v,w,THROW(overflow_error))
 protected versions More...
 
#define value_protected_product(v, w)    v=value_protected_mult(v,w)
 
#define value_mult(v, w)
 whether the default is protected or not this define makes no sense any more... More...
 
#define value_product(v, w)   v=value_mult(v,w)
 
#define ABS(x)   (((x)>=0) ? (x) : -(x))
 was: #define value_mult(v,w) value_direct_multiply(v,w) #define value_product(v,w) value_direct_product(v,w) could be: protected versions... More...
 
#define MIN(x, y)   (((x)>=(y))?(y):(x))
 minimum and maximum if they are defined somewhere else, they are very likely to be defined the same way. More...
 
#define MAX(x, y)   (((x)>=(y))?(x):(y))
 
#define SIGN(x)   (((x)>0)? 1 : ((x)==0? 0 : -1))
 signe d'un entier: -1, 0 ou 1 More...
 
#define DIVIDE(x, y)
 division avec reste toujours positif basee sur les equations: a/(-b) = - (a/b) (-a)/b = - ((a+b-1)/b) ou a et b sont des entiers positifs More...
 
#define POSITIVE_DIVIDE(x, y)   ((x)>0 ? (x)/(y) : - (-(x)+(y)-1)/(y))
 division avec reste toujours positif quand y est positif: assert(y>=0) More...
 
#define MODULO(x, y)   ((y)>0 ? POSITIVE_MODULO(x,y) : POSITIVE_MODULO(-x,-y))
 modulo a resultat toujours positif More...
 
#define POSITIVE_MODULO(x, y)
 modulo par rapport a un nombre positif: assert(y>=0) More...
 
#define pgcd(a, b)   pgcd_slow(a,b)
 Pour la recherche de performance, selection d'une implementation particuliere des fonctions. More...
 
#define divide(a, b)   DIVIDE(a,b)
 
#define modulo(a, b)   MODULO(a,b)
 
#define _has_yy_size_t
 

Typedefs

typedef int Value
 
typedef struct col tableau
 
typedef size_t yy_size_t
 

Functions

void __attribute__ ((weak, noreturn)) throw_exception(const int
 

Variables

void const char const char const int
 

Macro Definition Documentation

◆ __LONG_LONG_MAX__

#define __LONG_LONG_MAX__   9223372036854775807LL

put there because I cannot have these constants with ansi options.

would fix on solaris: #define LONG_LONG_MAX LLONG_MAX #define LONG_LONG_MIN LLONG_MIN

Definition at line 90 of file arithmetique-local.h.

◆ _has_yy_size_t

#define _has_yy_size_t

Definition at line 589 of file arithmetique-local.h.

◆ ABS

#define ABS (   x)    (((x)>=0) ? (x) : -(x))

was: #define value_mult(v,w) value_direct_multiply(v,w) #define value_product(v,w) value_direct_product(v,w) could be: protected versions...

LINEAR_VALUE_IS_CHARS is used for type checking. some operations are not allowed on (char*), thus they are switched to some other operation here... valeur absolue

Definition at line 529 of file arithmetique-local.h.

◆ CURRENT_FUNCTION

#define CURRENT_FUNCTION   "<unknown>"

package arithmetique

Francois Irigoin, mai 1989

Modifications

  • reprise de DIVIDE qui etait faux (Remi Triolet, Francois Irigoin, april 90)
  • simplification de POSITIVE_DIVIDE par suppression d'un modulo We would like linear to be generic about the "integer" type used to represent integer values. Thus Value is defined here. It should be changed to "int" "long" or "long long". In an ideal world, any source modification should be limited to this package.

Indeed, we cannot switch easily to bignums that need constructors dans destructors... That would lead to too many modifications... C++ would make things easier and cleaner...

Fabien COELHO for FILE * to be included for _MIN and _MAX: include <limits.h>

Definition at line 64 of file arithmetique-local.h.

◆ divide

#define divide (   a,
 
)    DIVIDE(a,b)

Definition at line 576 of file arithmetique-local.h.

◆ DIVIDE

#define DIVIDE (   x,
 
)
Value:
((y)>0? POSITIVE_DIVIDE(x,y) : \
-POSITIVE_DIVIDE((x),(-(y))))
#define POSITIVE_DIVIDE(x, y)
division avec reste toujours positif quand y est positif: assert(y>=0)
static char * x
Definition: split_file.c:159

division avec reste toujours positif basee sur les equations: a/(-b) = - (a/b) (-a)/b = - ((a+b-1)/b) ou a et b sont des entiers positifs

Definition at line 552 of file arithmetique-local.h.

◆ double_to_value

#define double_to_value (   d)    ((Value)(d))

Definition at line 320 of file arithmetique-local.h.

◆ float_to_value

#define float_to_value (   f)    ((Value)(f))

Definition at line 319 of file arithmetique-local.h.

◆ int_to_value

#define int_to_value (   i)    ((Value)(i))

end LINEAR_VALUE_IS_INT

cast to value

Definition at line 317 of file arithmetique-local.h.

◆ LINEAR_VALUE_STRING

#define LINEAR_VALUE_STRING   "int"

default: LINEAR_VALUE_IS_INT

Definition at line 295 of file arithmetique-local.h.

◆ LONG_LONG_MAX

#define LONG_LONG_MAX   __LONG_LONG_MAX__

Definition at line 93 of file arithmetique-local.h.

◆ LONG_LONG_MIN

#define LONG_LONG_MIN   (-LONG_LONG_MAX-1)

Definition at line 95 of file arithmetique-local.h.

◆ long_to_value

#define long_to_value (   l)    ((Value)(l))

Definition at line 318 of file arithmetique-local.h.

◆ MAX

#define MAX (   x,
 
)    (((x)>=(y))?(x):(y))

Definition at line 540 of file arithmetique-local.h.

◆ MIN

#define MIN (   x,
 
)    (((x)>=(y))?(y):(x))

minimum and maximum if they are defined somewhere else, they are very likely to be defined the same way.

Thus the previous def is not overwritten.

Definition at line 537 of file arithmetique-local.h.

◆ modulo

#define modulo (   a,
 
)    MODULO(a,b)

Definition at line 578 of file arithmetique-local.h.

◆ MODULO

#define MODULO (   x,
 
)    ((y)>0 ? POSITIVE_MODULO(x,y) : POSITIVE_MODULO(-x,-y))

modulo a resultat toujours positif

Definition at line 559 of file arithmetique-local.h.

◆ pgcd

#define pgcd (   a,
 
)    pgcd_slow(a,b)

Pour la recherche de performance, selection d'une implementation particuliere des fonctions.

Definition at line 574 of file arithmetique-local.h.

◆ POP_TIMEOUT

#define POP_TIMEOUT ( )     pop_timeout(CURRENT_FUNCTION, __FILE__, __LINE__)

Definition at line 77 of file arithmetique-local.h.

◆ POP_TIMEOUT_ENV

#define POP_TIMEOUT_ENV (   env)     pop_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__)

Definition at line 71 of file arithmetique-local.h.

◆ POSITIVE_DIVIDE

#define POSITIVE_DIVIDE (   x,
 
)    ((x)>0 ? (x)/(y) : - (-(x)+(y)-1)/(y))

division avec reste toujours positif quand y est positif: assert(y>=0)

Definition at line 556 of file arithmetique-local.h.

◆ POSITIVE_MODULO

#define POSITIVE_MODULO (   x,
 
)
Value:
((x) > 0 ? (x)%(y) : \
((x)%(y) == 0 ? 0 : ((y)-(-(x))%(y))))

modulo par rapport a un nombre positif: assert(y>=0)

Ce n'est pas la macro la plus efficace que j'aie jamais ecrite: il faut faire, dans le pire des cas, deux appels a la routine .rem, qui n'est surement pas plus cablee que la division ou la multiplication

Definition at line 567 of file arithmetique-local.h.

◆ PUSH_TIMEOUT

#define PUSH_TIMEOUT (   delay)     push_timeout(delay, CURRENT_FUNCTION, __FILE__, __LINE__)

Definition at line 74 of file arithmetique-local.h.

◆ PUSH_TIMEOUT_ENV

#define PUSH_TIMEOUT_ENV (   env)     push_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__)

Definition at line 68 of file arithmetique-local.h.

◆ SIGN

#define SIGN (   x)    (((x)>0)? 1 : ((x)==0? 0 : -1))

signe d'un entier: -1, 0 ou 1

Definition at line 544 of file arithmetique-local.h.

◆ ULONG_LONG_MAX

#define ULONG_LONG_MAX   (LONG_LONG_MAX * 2ULL + 1)

Definition at line 97 of file arithmetique-local.h.

◆ value_abs

#define value_abs (   val)
Value:
((value_posz_p(val) ? (val) : \
(value_ne((val), VALUE_NAN) ? value_uminus(val) : \
@ overflow_error
#define THROW(what)
#define value_uminus(val)
unary operators on values
#define value_ne(v1, v2)
#define VALUE_NAN
#define value_posz_p(val)

Definition at line 379 of file arithmetique-local.h.

◆ value_absolute

#define value_absolute (   ref)    value_assign(ref,value_abs(ref))

Definition at line 369 of file arithmetique-local.h.

◆ value_addto

#define value_addto (   ref,
  val 
)    (ref+=(val))

Definition at line 359 of file arithmetique-local.h.

◆ value_and

#define value_and (   v1,
  v2 
)    ((v1)&(v2))

Definition at line 352 of file arithmetique-local.h.

◆ value_andto

#define value_andto (   ref,
  val 
)    (ref &= (val))

Definition at line 373 of file arithmetique-local.h.

◆ value_assign

#define value_assign (   ref,
  val 
)    (ref=(val))

assigments

Definition at line 358 of file arithmetique-local.h.

◆ value_compare

#define value_compare (   v1,
  v2 
)    (value_eq(v1,v2)?0:value_lt(v1,v2)?-1:1)

Definition at line 334 of file arithmetique-local.h.

◆ VALUE_CONST

#define VALUE_CONST (   val)    (val)

Definition at line 298 of file arithmetique-local.h.

◆ value_decrement

#define value_decrement (   ref)    (ref--)

Definition at line 364 of file arithmetique-local.h.

◆ value_direct_multiply

#define value_direct_multiply (   v1,
  v2 
)    ((v1)*(v2)) /**direct! */

Definition at line 345 of file arithmetique-local.h.

◆ value_direct_product

#define value_direct_product (   ref,
  val 
)    (ref*=(val)) /**direct! */

Definition at line 361 of file arithmetique-local.h.

◆ value_div

#define value_div (   v1,
  v2 
)    ((v1)/(v2))

Definition at line 343 of file arithmetique-local.h.

◆ value_division

#define value_division (   ref,
  val 
)    (ref/=(val))

Definition at line 365 of file arithmetique-local.h.

◆ value_eq

#define value_eq (   v1,
  v2 
)    ((v1)==(v2))

bool operators on values

Definition at line 324 of file arithmetique-local.h.

◆ VALUE_FMT

#define VALUE_FMT   "%d"

Definition at line 297 of file arithmetique-local.h.

◆ value_ge

#define value_ge (   v1,
  v2 
)    ((v1)>=(v2))

Definition at line 327 of file arithmetique-local.h.

◆ value_gt

#define value_gt (   v1,
  v2 
)    ((v1)>(v2))

Definition at line 326 of file arithmetique-local.h.

◆ value_increment

#define value_increment (   ref)    (ref++)

Definition at line 360 of file arithmetique-local.h.

◆ value_le

#define value_le (   v1,
  v2 
)    ((v1)<=(v2))

Definition at line 329 of file arithmetique-local.h.

◆ value_lshift

#define value_lshift (   v1,
  v2 
)    ((v1)<<(v2))

Definition at line 353 of file arithmetique-local.h.

◆ value_lt

#define value_lt (   v1,
  v2 
)    ((v1)<(v2))

Definition at line 328 of file arithmetique-local.h.

◆ VALUE_MAX

#define VALUE_MAX   INT_MAX

Definition at line 301 of file arithmetique-local.h.

◆ value_max

#define value_max (   v1,
  v2 
)    (value_ge(v1,v2)? (v1): (v2))

Definition at line 350 of file arithmetique-local.h.

◆ value_max_p

#define value_max_p (   val)    value_eq(val,VALUE_MAX)

Definition at line 397 of file arithmetique-local.h.

◆ value_maximum

#define value_maximum (   ref,
  val 
)    value_assign(ref,value_max(ref,val))

Definition at line 371 of file arithmetique-local.h.

◆ VALUE_MIN

#define VALUE_MIN   (INT_MIN+1)

Definition at line 300 of file arithmetique-local.h.

◆ value_min

#define value_min (   v1,
  v2 
)    (value_le(v1,v2)? (v1): (v2))

Definition at line 349 of file arithmetique-local.h.

◆ value_min_p

#define value_min_p (   val)    value_eq(val,VALUE_MIN)

Definition at line 396 of file arithmetique-local.h.

◆ value_minimum

#define value_minimum (   ref,
  val 
)    value_assign(ref,value_min(ref,val))

Definition at line 370 of file arithmetique-local.h.

◆ value_minus

#define value_minus (   v1,
  v2 
)    ((v1)-(v2))

Definition at line 346 of file arithmetique-local.h.

◆ value_mod

#define value_mod (   v1,
  v2 
)    ((v1)%(v2))

Definition at line 344 of file arithmetique-local.h.

◆ value_modulus

#define value_modulus (   ref,
  val 
)    (ref%=(val))

Definition at line 366 of file arithmetique-local.h.

◆ VALUE_MONE

#define VALUE_MONE   -1

Definition at line 304 of file arithmetique-local.h.

◆ value_mone_p

#define value_mone_p (   val)    value_eq(val,VALUE_MONE)

Definition at line 394 of file arithmetique-local.h.

◆ value_mult

#define value_mult (   v,
 
)
Value:
(fprintf(stderr,"[value_mult] value overflow!\n"),THROW(overflow_error)))
#define value_protected_multiply(v, w, throw)
is a software idiv is assumed, quick check performed first
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

whether the default is protected or not this define makes no sense any more...

well, doesn't matter. FC. I do enforce the protection whatever requested:-) prints out a message and throws the exception, hoping that some valid CATCH waits for it upwards.

Definition at line 444 of file arithmetique-local.h.

◆ value_multiply

#define value_multiply (   ref,
  val 
)    value_assign(ref,value_mult(ref,val))

Definition at line 362 of file arithmetique-local.h.

◆ VALUE_NAN

#define VALUE_NAN   INT_MIN

Definition at line 299 of file arithmetique-local.h.

◆ value_ne

#define value_ne (   v1,
  v2 
)    ((v1)!=(v2))

Definition at line 325 of file arithmetique-local.h.

◆ value_neg_p

#define value_neg_p (   val)    value_lt(val,VALUE_ZERO)

Definition at line 385 of file arithmetique-local.h.

◆ value_negz_p

#define value_negz_p (   val)    value_le(val,VALUE_ZERO)

Definition at line 387 of file arithmetique-local.h.

◆ value_not

#define value_not (   val)    (~(val))

Definition at line 378 of file arithmetique-local.h.

◆ value_notmax_p

#define value_notmax_p (   val)    value_ne(val,VALUE_MAX)

Definition at line 399 of file arithmetique-local.h.

◆ value_notmin_p

#define value_notmin_p (   val)    value_ne(val,VALUE_MIN)

Definition at line 398 of file arithmetique-local.h.

◆ value_notmone_p

#define value_notmone_p (   val)    value_ne(val,VALUE_MONE)

Definition at line 395 of file arithmetique-local.h.

◆ value_notone_p

#define value_notone_p (   val)    value_ne(val,VALUE_ONE)

Definition at line 393 of file arithmetique-local.h.

◆ value_notzero_p

#define value_notzero_p (   val)    value_ne(val,VALUE_ZERO)

Definition at line 391 of file arithmetique-local.h.

◆ VALUE_ONE

#define VALUE_ONE   1

Definition at line 303 of file arithmetique-local.h.

◆ value_one_p

#define value_one_p (   val)    value_eq(val,VALUE_ONE)

Definition at line 392 of file arithmetique-local.h.

◆ value_oppose

#define value_oppose (   ref)    value_assign(ref,value_uminus(ref))

Definition at line 368 of file arithmetique-local.h.

◆ value_or

#define value_or (   v1,
  v2 
)    ((v1)|(v2))

Definition at line 351 of file arithmetique-local.h.

◆ value_orto

#define value_orto (   ref,
  val 
)    (ref |= (val))

Definition at line 372 of file arithmetique-local.h.

◆ value_pdiv

#define value_pdiv (   v1,
  v2 
)    (divide(v1,v2))

Definition at line 347 of file arithmetique-local.h.

◆ value_pdivision

#define value_pdivision (   ref,
  val 
)    value_assign(ref,value_pdiv(ref,val))

Definition at line 367 of file arithmetique-local.h.

◆ value_plus

#define value_plus (   v1,
  v2 
)    ((v1)+(v2))

binary operators on values

pdiv and pmod always return a positive remainder and a positive modulo. E.g. -1/100 = -1 and its remainder is 99. The modulo operator is periodic and not symmetric around zero.

Definition at line 342 of file arithmetique-local.h.

◆ value_pmod

#define value_pmod (   v1,
  v2 
)    (modulo(v1,v2))

Definition at line 348 of file arithmetique-local.h.

◆ value_pos_p

#define value_pos_p (   val)    value_gt(val,VALUE_ZERO)

Definition at line 384 of file arithmetique-local.h.

◆ value_posz_p

#define value_posz_p (   val)    value_ge(val,VALUE_ZERO)

Definition at line 386 of file arithmetique-local.h.

◆ value_product

#define value_product (   v,
 
)    v=value_mult(v,w)

Definition at line 447 of file arithmetique-local.h.

◆ value_protected_hard_idiv_multiply

#define value_protected_hard_idiv_multiply (   v,
  w,
  throw 
)
Value:
#define VALUE_ZERO
#define value_direct_multiply(v1, v2)
#define value_zero_p(val)
#define VALUE_MAX
#define value_abs(val)
#define value_lt(v1, v2)
#define value_div(v1, v2)

(|v| < MAX / |w|) => v*w is okay I could check ((v*w)/w)==v but a tmp would be useful

Definition at line 408 of file arithmetique-local.h.

◆ value_protected_mult

#define value_protected_mult (   v,
 
)     value_protected_multiply(v,w,THROW(overflow_error))

protected versions

Definition at line 427 of file arithmetique-local.h.

◆ value_protected_multiply

#define value_protected_multiply (   v,
  w,
  throw 
)     value_protected_hard_idiv_multiply(v,w,throw)

is a software idiv is assumed, quick check performed first

Definition at line 421 of file arithmetique-local.h.

◆ value_protected_product

#define value_protected_product (   v,
 
)     v=value_protected_mult(v,w)

Definition at line 429 of file arithmetique-local.h.

◆ value_rshift

#define value_rshift (   v1,
  v2 
)    ((v1)>>(v2))

Definition at line 354 of file arithmetique-local.h.

◆ value_sign

#define value_sign (   v)    (value_eq(v,VALUE_ZERO)?0:value_lt(v,VALUE_ZERO)?-1:1)

trian operators on values

Definition at line 333 of file arithmetique-local.h.

◆ value_substract

#define value_substract (   ref,
  val 
)    (ref-=(val))

Definition at line 363 of file arithmetique-local.h.

◆ VALUE_TO_DOUBLE

#define VALUE_TO_DOUBLE (   val)    ((double)(val))

Definition at line 308 of file arithmetique-local.h.

◆ VALUE_TO_FLOAT

#define VALUE_TO_FLOAT (   val)    ((float)(val))

Definition at line 307 of file arithmetique-local.h.

◆ VALUE_TO_INT

#define VALUE_TO_INT (   val)    ((int)(val))

Definition at line 306 of file arithmetique-local.h.

◆ VALUE_TO_LONG

#define VALUE_TO_LONG (   val)    ((long)(val))

Definition at line 305 of file arithmetique-local.h.

◆ value_uminus

#define value_uminus (   val)    (-(val))

unary operators on values

Definition at line 377 of file arithmetique-local.h.

◆ VALUE_ZERO

#define VALUE_ZERO   0

Definition at line 302 of file arithmetique-local.h.

◆ value_zero_p

#define value_zero_p (   val)    value_eq(val,VALUE_ZERO)

Definition at line 388 of file arithmetique-local.h.

Typedef Documentation

◆ tableau

typedef struct col tableau

◆ Value

typedef int Value

Definition at line 296 of file arithmetique-local.h.

◆ yy_size_t

typedef size_t yy_size_t

Definition at line 590 of file arithmetique-local.h.

Function Documentation

◆ __attribute__()

void __attribute__ ( (weak, noreturn)  ) const

Variable Documentation

◆ int

void const char const char const int

Definition at line 585 of file arithmetique-local.h.

Referenced by __attribute__(), abc_with_allocation_size(), adapt_reference_to_type(), add_implicitly_killed_arcs_to_kill_set(), add_prettyprint_control_list_to_declaration_statement(), adg_dataflowgraph_with_extremities(), adg_dup_disjunctive_nodes(), adg_fprint_dfg(), adg_pure_dfg(), adg_pure_dfg2(), adg_update_dfg(), adg_vertex_to_ordering(), any_assign_to_transformer(), any_user_call_site_to_transformer(), array_type_dimension(), binary_arithmetic_operator_to_post_pv(), bmat_extend(), bmat_fprint(), bootstrap(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), broadcast_conditions(), bvec_lor(), c_convex_effects_on_actual_parameter_forward_translation(), calculate_delay(), chernikova(), clear_log_subwindow(), commutative_operation_p(), complete_points_to_reference_with_fixed_subscripts(), compute_points_to_binded_set(), compute_points_to_gen_set(), conflict_dup(), consistent_points_to_arc_p(), constant_constraint_check(), constrs_of_sc(), controlize_sequence(), convert_bound_expression(), create_frames(), create_icon(), cutting_conditions(), dag_terapix_measures(), dag_vertex_preds(), dagvtx_spoc_priority(), dagvtx_terapix_priority(), dbll_stat_file(), do_brace_expression_to_updated_type(), do_computation_intensity(), do_loop_nest_unswitching(), do_slightly_rename_entities(), do_solve_hardware_constraints_on_volume(), ecrit_ligne(), effect_indices_first_pointer_dimension_rank(), effect_reference_dereferencing_p(), entity_flow_or_context_sentitive_heap_location(), equal_condition_to_points_to(), expression_to_points_to(), filter_formal_context_according_to_actual_context(), find_intermediate_constraints_recursively(), find_pattern(), fprint_delay(), freia_dag_optimize(), freia_terapix_call(), full_copy_p(), gen_array_index(), gen_array_resize(), gen_may_constant_paths(), gen_may_set(), gen_must_constant_paths(), gen_must_set(), generic_effect_find_aliases_with_simple_pointer_values(), generic_substitute_formal_array_elements_in_transformer(), generic_transform_sink_cells_from_matching_list(), generic_unary_operation_to_transformer(), get_dma_name(), get_final_offset(), hash_table_generic_make(), implicit_type_p(), ImplicitType(), initial_code_abc_reference(), insert_something_in_the_wpips_log_window(), integer_minmax_to_transformer(), integer_power_to_transformer(), internal_pointer_assignment_to_points_to(), intrinsic_call_to_points_to_sinks(), is_not_trivial_p(), IsCapKeyword(), kill_must_set(), lhs_expression_to_transformer(), list_of_same_or_equivalence_arguments(), load_cost_file(), look_for_the_best_counter(), main(), make_array_bounds(), make_list_of_flags(), make_required(), MakeParameter(), mapping_on_broadcast(), MAX_ROOM_NEEDED(), maximal_out_degree_of_points_to_graph(), mchoose(), mchoose_de_select_all_notify(), mchoose_notify(), mchoose_ok_notify(), memory_dereferencing_p(), NeedKeyword(), new_array_elements_backward_substitution_in_transformer(), new_array_elements_forward_substitution_in_transformer(), new_ecrit_ligne(), new_filter_formal_context_according_to_actual_context(), non_equal_condition_to_points_to(), normalize_subscript_expression(), null_equal_condition_to_points_to(), old_prototype_factorize(), opencl_compile_mergeable_dag(), opencl_generate_special_kernel_ops(), opencl_merge_and_compile(), parallel_tiling(), parameter_passing_mode_p(), partial_broadcast_coefficients(), place_frames(), plc_elim_var_with_eg(), plc_make_min_dim(), plc_make_vvs_with_vector(), pointer_reference_to_expression(), pointer_source_to_sinks(), points_to_array_reference_p(), points_to_reference_to_translation(), points_to_reference_to_type(), points_to_reference_to_typed_index(), points_to_reference_update_final_subscripts(), points_to_translation_of_formal_parameters(), polynome_degree(), polynome_max_degree(), polynomial_to_numerical(), prgm_mapping(), PRINTF_PARSE(), r_cell_reference_to_type(), recursive_filter_formal_context_according_to_actual_context(), reduce_sequence(), reference_dereferencing_to_points_to(), reference_filter(), reference_to_points_to_sinks(), reference_to_points_to_translations(), reference_written_p(), references_must_conflict_p(), regions_to_loops(), remove_redundants(), replace_control_with_unstructured(), sc_delimiter(), ScanNewFile(), schoose(), schoose_close(), schoose_ok_notify(), simple_pv_translate(), string_to_expression(), struct_reference_assignment_or_equality_to_transformer(), tab_alloc(), tiling_transformation(), tpips_lex_print_pos(), translate_complexity_from_local_to_current_name(), VASNPRINTF(), vect_make_dense(), where_to_perform_operation(), whileloop_to_postcondition(), window_number_notify(), words_points_to_reference(), xml_Array(), xml_Boxes(), xml_Chain_Graph(), xml_FormalVariables(), xml_loop_from_sequence(), xml_ParameterUseToArrayBound(), xml_Pattern_Paving(), xml_Region_Range(), xml_TaskParameters(), xml_tasks(), xml_tasks_with_motif(), xml_tiling(), xml_Type_Entity(), zmat_alloc(), zmat_extend(), zmat_fprint(), zvec_alloc(), zvec_free(), zvec_gcd(), zvec_index_first_notzero(), and zvec_min_notzero().