Need to allow for one spare encoding for the non-executed case with no suitable stores.
[satcheck.git] / epvalue.h
1 /*      Copyright (c) 2015 Regents of the University of California
2  *
3  *      Author: Brian Demsky <bdemsky@uci.edu>
4  *
5  *      This program is free software; you can redistribute it and/or
6  *      modify it under the terms of the GNU General Public License
7  *      version 2 as published by the Free Software Foundation.
8  */
9
10 #ifndef EPVALUE_H
11 #define EPVALUE_H
12 #include "classlist.h"
13 #include "mymemory.h"
14 #include "stl-model.h"
15 #include "mcutil.h"
16
17 #define VC_ADDRINDEX 0
18 #define VC_RFINDEX 1
19 #define VC_BASEINDEX 2
20 #define VC_OLDVALCASINDEX 3
21 #define VC_RMWOUTINDEX 4
22 #define VC_VALOUTINDEX 5
23 #define VC_FUNCOUTINDEX 1
24
25 class EPValue {
26 public:
27         EPValue(ExecPoint *, EPRecord *, const void *addr, uint64_t value, int len);
28         ~EPValue();
29         uint64_t getValue() {return value;}
30         ExecPoint * getEP() {return execpoint;}
31         const void *getAddr() {return addr;}
32         int getLen() {return len;}
33         EPRecord * getFirstRecord() {return firstrecord;}
34         EPRecord *firstrecord;
35         EPRecord *lastrecord;
36         EPRecord * getRecord() {return record;}
37
38         MEMALLOC;
39 private:
40         ExecPoint * execpoint;
41         EPRecord *record;
42         const void *addr;
43         uint64_t value;
44         int len;
45         friend bool EPValueEquals(EPValue * ep1, EPValue *ep2);
46         friend unsigned int EPValueHash(EPValue *ep);
47 };
48
49 bool EPValueEquals(EPValue * ep1, EPValue *ep2);
50 unsigned int EPValueHash(EPValue *ep);
51 #endif