-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPInt.hxx
61 lines (51 loc) · 1.59 KB
/
APInt.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef APInt_hxx
#define APInt_hxx
#include <memory>
#include "llvm/Constant.h"
class APInt;
#include "state.hxx"
#define UNSIGN_LONG_LONG_HIGH_BIT 0x8000000000000000LL
#define LONG_LONG_HIGH_BIT 0x4000000000000000LL
#define STD_LONG_LONG_MAX 0x7FFFFFFFFFFFFFFFLL
#define LONG_LONG_LOWER_HALF 0x00000000FFFFFFFFLL
#define LONG_LONG_UPPER_HALF 0x7FFFFFFF00000000LL
#define LONG_LONG_LOWER_31 0x000000007FFFFFFFLL
#define UNSIGN_LONG_LONG_UPPER_33 0xFFFFFFFF80000000LL
struct JITAPInt {
long long int value;
JITAPInt* next;
};
std::pair<long long int, long long int> lladdwithcarry(long long int value1, long long int value2);
void FreeJITAPInt(JITAPInt* value);
bool JITAPIntlessthan(const JITAPInt const * lhs, const JITAPInt const* rhs);
JITAPInt JITAPIntTimes(JITAPInt value1,JITAPInt value2);
class APInt {
private:
JITAPInt value;
llvm::Constant* Serializehelper(std::shared_ptr<codegenState> state, JITAPInt* pos);
public:
APInt() : value({0,nullptr}) {}
APInt(long long int value) : value({value,nullptr}) {}
APInt(JITAPInt* value);
~APInt();
llvm::Constant* Serialize(std::shared_ptr<codegenState> state);
bool operator< (const APInt rhs) const;
operator std::string () const;
JITAPInt GetJITAPInt() const {return value;}
};
class APIntBuilder {
private:
JITAPInt value;
void addOne(JITAPInt* value);
public:
APIntBuilder() : value({0,nullptr}) {}
~APIntBuilder();
void makeNegative();
void doubleval();
void multiplyby10();
void addOne();
void add(char value);
operator APInt();
bool operator< (const APInt rhs) const;
};
#endif