- cleaned up FxCompareRel::Resolve. Also added unsigned integer support to it and FxMulDiv (these, aside from the float cast, are the only two operations where this is important.)

This commit is contained in:
Christoph Oelckers 2016-11-18 12:23:58 +01:00
commit d9953eb3bd
2 changed files with 79 additions and 18 deletions

View file

@ -169,10 +169,16 @@ struct ExpVal
return regtype == REGT_INT ? Int : regtype == REGT_FLOAT ? int(Float) : 0;
}
unsigned GetUInt() const
{
int regtype = Type->GetRegType();
return regtype == REGT_INT ? unsigned(Int) : regtype == REGT_FLOAT ? unsigned(Float) : 0;
}
double GetFloat() const
{
int regtype = Type->GetRegType();
return regtype == REGT_INT ? double(Int) : regtype == REGT_FLOAT ? Float : 0;
return regtype == REGT_INT ? (Type == TypeUInt32? double(unsigned(Int)) : double(Int)) : regtype == REGT_FLOAT ? Float : 0;
}
void *GetPointer() const
@ -864,6 +870,7 @@ public:
class FxCompareRel : public FxBinary
{
PType *CompareType;
public:
FxCompareRel(int, FxExpression*, FxExpression*);