Basic constant propagation.

This commit is contained in:
Ben Vanik
2013-12-07 05:52:51 -08:00
parent 57432d5996
commit 3b268f07ef
10 changed files with 584 additions and 147 deletions

View File

@@ -128,6 +128,11 @@ public:
flags |= VALUE_IS_CONSTANT;
constant.v128 = value;
}
void set_from(const Value* other) {
type = other->type;
flags = other->flags;
constant.v128 = other->constant.v128;
}
inline bool IsConstant() const {
return !!(flags & VALUE_IS_CONSTANT);
@@ -184,6 +189,7 @@ public:
void Neg();
void Abs();
void Sqrt();
void RSqrt();
void And(Value* other);
void Or(Value* other);
void Xor(Value* other);