use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method FDIV.
@Override
public void FDIV(float rhsValue) {
RealValue right = env.topFrame().operandStack.popFp32();
RealValue left = env.topFrame().operandStack.popFp32();
float left_concrete_value = ((Double) left.getConcreteValue()).floatValue();
float right_concrete_value = ((Double) right.getConcreteValue()).floatValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewRealConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewRealConstant(right_concrete_value);
}
float con = left_concrete_value / right_concrete_value;
RealValue realExpr = ExpressionFactory.div(left, right, (double) con);
env.topFrame().operandStack.pushFp32(realExpr);
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method FNEG.
@Override
public void FNEG() {
RealValue param = env.topFrame().operandStack.popFp32();
float param_concrete_value = ((Double) param.getConcreteValue()).floatValue();
if (!param.containsSymbolicVariable()) {
param = ExpressionFactory.buildNewRealConstant(param_concrete_value);
}
float con = -param_concrete_value;
RealValue realExpr = new RealUnaryExpression(param, Operator.NEG, (double) con);
env.topFrame().operandStack.pushFp32(realExpr);
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method D2L.
@Override
public void D2L() {
RealValue realExpr = env.topFrame().operandStack.popFp64();
double doubleValue = ((Double) realExpr.getConcreteValue()).doubleValue();
IntegerValue intExpr;
long concreteValue = (long) doubleValue;
if (!realExpr.containsSymbolicVariable()) {
intExpr = ExpressionFactory.buildNewIntegerConstant(concreteValue);
} else {
intExpr = new RealToIntegerCast(realExpr, concreteValue);
}
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method L2F.
@Override
public void L2F() {
IntegerValue integerExpr = env.topFrame().operandStack.popBv64();
long longValue = ((Long) integerExpr.getConcreteValue()).longValue();
RealValue realExpr;
float concreteValue = (float) longValue;
if (!integerExpr.containsSymbolicVariable()) {
realExpr = ExpressionFactory.buildNewRealConstant(concreteValue);
} else {
realExpr = new IntegerToRealCast(integerExpr, (double) concreteValue);
}
env.topFrame().operandStack.pushFp32(realExpr);
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class ArithmeticVM method DSUB.
@Override
public void DSUB() {
RealValue right = env.topFrame().operandStack.popFp64();
RealValue left = env.topFrame().operandStack.popFp64();
double left_concrete_value = ((Double) left.getConcreteValue()).doubleValue();
double right_concrete_value = ((Double) right.getConcreteValue()).doubleValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewRealConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewRealConstant(right_concrete_value);
}
double con = left_concrete_value - right_concrete_value;
RealValue realExpr = new RealBinaryExpression(left, Operator.MINUS, right, con);
env.topFrame().operandStack.pushFp64(realExpr);
}
Aggregations