{
noway_assert(op2->gtOper == GT_CNS_DBL);
/* If we have an NaN value then don't record it */
- if (_isnan(op2->gtDblCon.gtDconVal))
+ if (_isnan(op2->AsDblCon()->gtDconVal))
{
goto DONE_ASSERTION; // Don't make an assertion
}
- assertion.op2.dconVal = op2->gtDblCon.gtDconVal;
+ assertion.op2.dconVal = op2->AsDblCon()->gtDconVal;
}
//
return nullptr;
}
newTree->ChangeOperConst(GT_CNS_DBL);
- newTree->gtDblCon.gtDconVal = curAssertion->op2.dconVal;
+ newTree->AsDblCon()->gtDconVal = curAssertion->op2.dconVal;
break;
case O2K_CONST_LONG:
{
double constant = vnStore->ConstantValue<double>(vnCns);
op1->ChangeOperConst(GT_CNS_DBL);
- op1->gtDblCon.gtDconVal = constant;
+ op1->AsDblCon()->gtDconVal = constant;
// Nothing can be equal to NaN. So if IL had "op1 == NaN", then we already made op1 NaN,
// which will yield a false correctly. Instead if IL had "op1 != NaN", then we already
{
float constant = vnStore->ConstantValue<float>(vnCns);
op1->ChangeOperConst(GT_CNS_DBL);
- op1->gtDblCon.gtDconVal = constant;
+ op1->AsDblCon()->gtDconVal = constant;
// See comments for TYP_DOUBLE.
allowReverse = (_isnan(constant) == 0);
}
// now. We don't create OAK_EQUAL assertion on floating point from GT_ASG
// because we depend on value num which would constant prop the NaN.
op1->ChangeOperConst(GT_CNS_DBL);
- op1->gtDblCon.gtDconVal = 0;
+ op1->AsDblCon()->gtDconVal = 0;
op2->ChangeOperConst(GT_CNS_DBL);
- op2->gtDblCon.gtDconVal = 0;
+ op2->AsDblCon()->gtDconVal = 0;
}
// Change the op1 LclVar to the op2 LclVar
else
case GT_CNS_DBL:
{
GenTreeDblCon* dblConst = tree->AsDblCon();
- double constValue = dblConst->gtDblCon.gtDconVal;
+ double constValue = dblConst->AsDblCon()->gtDconVal;
// TODO-ARM-CQ: Do we have a faster/smaller way to generate 0.0 in thumb2 ISA ?
if (targetType == TYP_FLOAT)
{
{
emitter* emit = GetEmitter();
emitAttr size = emitTypeSize(targetType);
- double constValue = tree->gtDblCon.gtDconVal;
+ double constValue = tree->AsDblCon()->gtDconVal;
// Make sure we use "xorps reg, reg" only for +ve zero constant (0.0) and not for -ve zero (-0.0)
if (*(__int64*)&constValue == 0)
break;
case GT_CNS_DBL:
- if (op1->gtDblCon.gtDconVal == op2->gtDblCon.gtDconVal)
+ if (op1->AsDblCon()->gtDconVal == op2->AsDblCon()->gtDconVal)
return true;
break;
#endif
#endif
break;
case GT_CNS_DBL:
- bits = *(UINT64*)(&tree->gtDblCon.gtDconVal);
+ bits = *(UINT64*)(&tree->AsDblCon()->gtDconVal);
#ifdef _HOST_64BIT_
add = bits;
#else // 32-bit host
level = 0;
/* We use fldz and fld1 to load 0.0 and 1.0, but all other */
/* floating point constants are loaded using an indirection */
- if ((*((__int64*)&(tree->gtDblCon.gtDconVal)) == 0) ||
- (*((__int64*)&(tree->gtDblCon.gtDconVal)) == I64(0x3ff0000000000000)))
+ if ((*((__int64*)&(tree->AsDblCon()->gtDconVal)) == 0) ||
+ (*((__int64*)&(tree->AsDblCon()->gtDconVal)) == I64(0x3ff0000000000000)))
{
costEx = 1;
costSz = 1;
goto DONE;
case GT_CNS_DBL:
- copy = gtNewDconNode(tree->gtDblCon.gtDconVal);
+ copy = gtNewDconNode(tree->AsDblCon()->gtDconVal);
copy->gtType = tree->gtType; // keep the same type
goto DONE;
break;
case GT_CNS_DBL:
- if (*((__int64*)&tree->gtDblCon.gtDconVal) == (__int64)I64(0x8000000000000000))
+ if (*((__int64*)&tree->AsDblCon()->gtDconVal) == (__int64)I64(0x8000000000000000))
{
printf(" -0.00000");
}
else
{
- printf(" %#.17g", tree->gtDblCon.gtDconVal);
+ printf(" %#.17g", tree->AsDblCon()->gtDconVal);
}
break;
case GT_CNS_STR:
/* Fold constant DOUBLE unary operator */
- d1 = op1->gtDblCon.gtDconVal;
+ d1 = op1->AsDblCon()->gtDconVal;
switch (tree->gtOper)
{
}
assert(op1->gtOper == GT_CNS_DBL);
- d1 = op1->gtDblCon.gtDconVal;
+ d1 = op1->AsDblCon()->gtDconVal;
assert(varTypeIsFloating(op2->gtType));
assert(op2->gtOper == GT_CNS_DBL);
- d2 = op2->gtDblCon.gtDconVal;
+ d2 = op2->AsDblCon()->gtDconVal;
/* Special case - check if we have NaN operands.
* For comparisons if not an unordered operation always return 0.
(tree->gtDebugFlags & GTF_DEBUG_NODE_LARGE));
tree->ChangeOperConst(GT_CNS_DBL);
- tree->gtDblCon.gtDconVal = d1;
+ tree->AsDblCon()->gtDconVal = d1;
if (vnStore != nullptr)
{
fgValueNumberTreeConst(tree);
inline bool GenTree::IsFPZero()
{
- if ((gtOper == GT_CNS_DBL) && (gtDblCon.gtDconVal == 0.0))
+ if ((gtOper == GT_CNS_DBL) && (AsDblCon()->gtDconVal == 0.0))
{
return true;
}
{
if (OperGet() == GT_CNS_DBL)
{
- double constValue = gtDblCon.gtDconVal;
+ double constValue = AsDblCon()->gtDconVal;
return *(__int64*)&constValue != 0;
}
case GT_CNS_DBL:
{
GenTreeDblCon* dblConst = tree->AsDblCon();
- double constValue = dblConst->gtDblCon.gtDconVal;
+ double constValue = dblConst->AsDblCon()->gtDconVal;
if (emitter::emitIns_valid_imm_for_fmov(constValue))
{
else if (varTypeIsFloating(tree->gtType))
{
commaOp2->ChangeOperConst(GT_CNS_DBL);
- commaOp2->gtDblCon.gtDconVal = 0.0;
+ commaOp2->AsDblCon()->gtDconVal = 0.0;
// Change the types of oper and commaOp2
oper->gtType = commaOp2->gtType = tree->gtType;
}
else if (varTypeIsFloating(typ))
{
commaOp2->ChangeOperConst(GT_CNS_DBL);
- commaOp2->gtDblCon.gtDconVal = 0.0;
+ commaOp2->AsDblCon()->gtDconVal = 0.0;
/* Change the types of oper and commaOp2 to TYP_DOUBLE */
op1->gtType = commaOp2->gtType = TYP_DOUBLE;
}
break;
case TYP_FLOAT:
- tree->gtVNPair.SetBoth(vnStore->VNForFloatCon((float)tree->gtDblCon.gtDconVal));
+ tree->gtVNPair.SetBoth(vnStore->VNForFloatCon((float)tree->AsDblCon()->gtDconVal));
break;
case TYP_DOUBLE:
- tree->gtVNPair.SetBoth(vnStore->VNForDoubleCon(tree->gtDblCon.gtDconVal));
+ tree->gtVNPair.SetBoth(vnStore->VNForDoubleCon(tree->AsDblCon()->gtDconVal));
break;
case TYP_REF:
if (tree->gtIntConCommon.IconValue() == 0)