public void Div(Operand result, Operand left, Operand right) { Primitive type = (Primitive)Math.Max((int)left.PType, (int)right.PType); if (!right.AsBoolean) result.Set(Primitive.Error, false, right.IsConst); else result.Set(type, left.AsSigned / right.AsSigned, left.IsConst && right.IsConst); }
private static void orLogic(Operand result, Operand left, Operand right) { if (left.PType == Primitive.Error) result.Set(Primitive.Error, false, left.IsConst); else if (left.AsBoolean) result.Set(Primitive.Boolean, true, left.IsConst); else if (right.PType == Primitive.Error) result.Set(Primitive.Error, false, left.IsConst && right.IsConst); else result.Set(Primitive.Boolean, right.AsBoolean, left.IsConst && right.IsConst); }
private static void isError(Operand result, Operand left, Operand right) { result.Set(Primitive.Error, false, left.IsConst && right.IsConst); }
public void Sub(Operand result, Operand left, Operand right) { Primitive type = (Primitive)Math.Max((int)left.PType, (int)right.PType); result.Set(type, left.AsSigned - right.AsSigned, left.IsConst && right.IsConst); }
public void NotEquals(Operand result, Operand left, Operand right) { result.Set(Primitive.Boolean, left.AsSigned != right.AsSigned, left.IsConst && right.IsConst); }
public void Not(Operand result, Operand left, Operand right) { result.Set(Primitive.Boolean, !right.AsBoolean, right.IsConst); }
public void MoreEq(Operand result, Operand left, Operand right) { result.Set(Primitive.Boolean, left.AsSigned >= right.AsSigned, left.IsConst && right.IsConst); }
public void Sub(Operand result, Operand left, Operand right) { result.Set(Primitive.Error, false, left.IsConst && right.IsConst); }
public void Equals(Operand result, Operand left, Operand right) { result.Set(Primitive.Boolean, left.AsBoolean == right.AsBoolean, left.IsConst && right.IsConst); }
public void Add(Operand result, Operand left, Operand right) { // TODO IsConst -> likely to be const type so const. result.Set(Primitive.Error, false, left.IsConst && right.IsConst); }
public void LessEq(Operand result, Operand left, Operand right) { result.Set(Primitive.Boolean, left.AsUnsigned <= right.AsUnsigned, left.IsConst && right.IsConst); }
public void Mul(Operand result, Operand left, Operand right) { Primitive type = (Primitive)Math.Max((int)left.PType, (int)right.PType); result.Set(type, left.AsDecimal * right.AsDecimal, left.IsConst && right.IsConst); }
public void More(Operand result, Operand left, Operand right) { result.Set(Primitive.Boolean, left.AsDecimal > right.AsDecimal, left.IsConst && right.IsConst); }