2016-09-26 07:00:19 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace llvm { class Value; }
|
|
|
|
namespace llvm { class Type; }
|
|
|
|
|
|
|
|
class SSAFloat;
|
|
|
|
|
|
|
|
class SSAInt
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SSAInt();
|
2016-10-01 09:47:21 +00:00
|
|
|
explicit SSAInt(int constant);
|
2016-09-26 07:00:19 +00:00
|
|
|
SSAInt(SSAFloat f);
|
|
|
|
explicit SSAInt(llvm::Value *v);
|
|
|
|
static SSAInt from_llvm(llvm::Value *v) { return SSAInt(v); }
|
|
|
|
static llvm::Type *llvm_type();
|
|
|
|
|
2016-09-30 05:27:25 +00:00
|
|
|
static SSAInt MIN(SSAInt a, SSAInt b);
|
|
|
|
static SSAInt MAX(SSAInt a, SSAInt b);
|
|
|
|
|
2016-10-08 07:29:26 +00:00
|
|
|
SSAInt add(SSAInt b, bool no_unsigned_wrap, bool no_signed_wrap);
|
2016-10-15 13:04:14 +00:00
|
|
|
SSAInt ashr(int bits);
|
2016-10-08 07:29:26 +00:00
|
|
|
|
2016-09-26 07:00:19 +00:00
|
|
|
llvm::Value *v;
|
|
|
|
};
|
|
|
|
|
|
|
|
SSAInt operator+(const SSAInt &a, const SSAInt &b);
|
|
|
|
SSAInt operator-(const SSAInt &a, const SSAInt &b);
|
|
|
|
SSAInt operator*(const SSAInt &a, const SSAInt &b);
|
|
|
|
SSAInt operator/(const SSAInt &a, const SSAInt &b);
|
|
|
|
SSAInt operator%(const SSAInt &a, const SSAInt &b);
|
|
|
|
|
|
|
|
SSAInt operator+(int a, const SSAInt &b);
|
|
|
|
SSAInt operator-(int a, const SSAInt &b);
|
|
|
|
SSAInt operator*(int a, const SSAInt &b);
|
|
|
|
SSAInt operator/(int a, const SSAInt &b);
|
|
|
|
SSAInt operator%(int a, const SSAInt &b);
|
|
|
|
|
|
|
|
SSAInt operator+(const SSAInt &a, int b);
|
|
|
|
SSAInt operator-(const SSAInt &a, int b);
|
|
|
|
SSAInt operator*(const SSAInt &a, int b);
|
|
|
|
SSAInt operator/(const SSAInt &a, int b);
|
|
|
|
SSAInt operator%(const SSAInt &a, int b);
|
|
|
|
|
|
|
|
SSAInt operator<<(const SSAInt &a, int bits);
|
|
|
|
SSAInt operator>>(const SSAInt &a, int bits);
|
2016-09-27 20:53:20 +00:00
|
|
|
SSAInt operator<<(const SSAInt &a, const SSAInt &bits);
|
|
|
|
SSAInt operator>>(const SSAInt &a, const SSAInt &bits);
|
|
|
|
|
|
|
|
SSAInt operator&(const SSAInt &a, int b);
|
|
|
|
SSAInt operator&(const SSAInt &a, const SSAInt &b);
|
|
|
|
SSAInt operator|(const SSAInt &a, int b);
|
|
|
|
SSAInt operator|(const SSAInt &a, const SSAInt &b);
|