24 #ifndef OTAWA_DATA_CLP_VALUE_H_
25 #define OTAWA_DATA_CLP_VALUE_H_
27 #include <elm/types.h>
28 #include <elm/type_info.h>
30 #include <elm/assert.h>
32 namespace otawa {
namespace clp {
70 inline bool isConst(
void)
const {
return delta() == 0 || mtimes() == 0; }
80 _mtimes(mtimes) { check(); }
83 _kind(val._kind), _lower(val._lower), _delta(val._delta),
84 _mtimes(val._mtimes) { }
90 _kind(
VAL), _lower(val), _delta(0), _mtimes(0) {}
97 inline bool isTop(
void)
const {
return _kind ==
ALL; }
101 (_kind == val.
_kind &&
119 return _lower >= val;
124 inline intn_t upper(
void)
const {
return _lower + _delta * _mtimes; }
133 return _lower + _delta * _mtimes;
145 return _lower + _delta * _mtimes;
182 void join(
const Value& val);
187 void widening(
const Value& val);
193 void ffwidening(
const Value& val,
int loopBound);
198 void inter(
const Value& val);
206 {
return _delta != 0 && _mtimes > (
MAXn - _lower) /
elm::abs(_delta); }
208 {
return _delta != 0 && _mtimes > (
UMAXn - _lower) /
elm::abs(_delta); }
Value & operator=(const Value &val)
Definition: ClpValue.h:92
bool operator==(const CString &s1, const CString &s2)
uintn_t mtimes(void) const
Definition: ClpValue.h:126
intn_t start(void) const
Definition: ClpValue.h:131
void print(io::Output &out) const
Print a human representation of the CLP.
Definition: clp_analysis.cpp:272
const uintn_t UMAXn
Definition: ClpValue.h:41
inst shr(int d, int a, int b)
Definition: inst.h:166
op_t reverse(op_t logop)
Definition: clp_symbolic_expr.cpp:301
static const Value none
Represents the bottom element.
Definition: ClpValue.h:219
Definition: ClpValue.h:55
intn_t _delta
Definition: ClpValue.h:244
elm::t::int32 intn_t
Definition: ClpValue.h:38
static int and_threshold
Find a file of 1 in a word.
Definition: ClpValue.h:68
Definition: ClpValue.h:54
Expression operator-(const Term &t1, const Term &t2)
Definition: expr.h:96
t::uint32 abs(t::int32 v)
Value(kind_t kind=VAL, intn_t lower=0, intn_t delta=0, uintn_t mtimes=0)
Constructor for a new CLP.
Definition: ClpValue.h:78
inst _and(int d, int a, int b)
Definition: inst.h:170
bool isConst(void) const
Definition: ClpValue.h:70
bool swrap(void) const
Definition: ClpValue.h:205
intn_t lower(void) const
Definition: ClpValue.h:123
const intn_t MINn
Definition: ClpValue.h:43
IntOption delta(command, 'D',"delta","use delta method with given sequence length","length", 4)
Inst::kind_t kind
Definition: odisasm.cpp:106
Value(const Value &val)
Copy constructor.
Definition: ClpValue.h:82
A set of values represented by a Circular Linear Progression.
Definition: ClpValue.h:66
kind_t
Allowed types for values: NONE represents nothing; REG is only used for addresses, and represents a register; VAL represents some values (either a constant or an interval); ALL is the Top element.
Definition: ClpValue.h:53
intn_t stop(void) const
Definition: ClpValue.h:141
static const Value all
Represents the top element.
Definition: ClpValue.h:221
Value(const int val)
Singleton constructor.
Definition: ClpValue.h:89
Definition: ClpValue.h:57
intn_t delta(void) const
Definition: ClpValue.h:125
void check(void)
Definition: ClpValue.h:240
bool operator!=(const Value &val) const
Definition: ClpValue.h:112
intn_t upper(void) const
Definition: ClpValue.h:124
sys::SystemOutStream & out
intn_t _lower
Definition: ClpValue.h:243
bool operator==(const Value &val) const
Definition: ClpValue.h:99
kind_t kind(void) const
Definition: ClpValue.h:122
void set(kind_t kind, intn_t lower, intn_t delta, uintn_t mtimes)
Set the values for the current object.
Definition: ClpValue.h:231
bool uwrap(void) const
Definition: ClpValue.h:207
Definition: ClpValue.h:56
const intn_t MAXn
Definition: ClpValue.h:42
elm::t::uint32 uintn_t
Definition: ClpValue.h:39
inst add(int d, int a, int b)
Definition: inst.h:163
inst sub(int d, int a, int b)
Definition: inst.h:164
bool isTop(void) const
Definition: ClpValue.h:97
bool operator>=(const int val) const
Definition: ClpValue.h:118
const int NBITS
Definition: ClpValue.h:37
kind_t _kind
Definition: ClpValue.h:242
elm::io::Output & operator<<(elm::io::Output &out, const otawa::clp::Value &val)
Definition: ClpValue.h:248
Expression operator+(const Term &t1, const Term &t2)
Definition: expr.h:95
inst shl(int d, int a, int b)
Definition: inst.h:165
t::uint64 STAT_UINT
Definition: ClpValue.h:40
uintn_t _mtimes
Definition: ClpValue.h:245
inst _or(int d, int a, int b)
Definition: inst.h:171