// so that they are contiguous with the incoming stack arguments.
saveRegsPlusPSPSize += MAX_REG_ARG * REGSIZE_BYTES;
}
- unsigned saveRegsPlusPSPSizeAligned = (unsigned)roundUp(saveRegsPlusPSPSize, STACK_ALIGN);
+ unsigned saveRegsPlusPSPSizeAligned = roundUp(saveRegsPlusPSPSize, STACK_ALIGN);
assert(compiler->lvaOutgoingArgSpaceSize % REGSIZE_BYTES == 0);
- unsigned outgoingArgSpaceAligned = (unsigned)roundUp(compiler->lvaOutgoingArgSpaceSize, STACK_ALIGN);
+ unsigned outgoingArgSpaceAligned = roundUp(compiler->lvaOutgoingArgSpaceSize, STACK_ALIGN);
unsigned maxFuncletFrameSizeAligned = saveRegsPlusPSPSizeAligned + outgoingArgSpaceAligned;
assert((maxFuncletFrameSizeAligned % STACK_ALIGN) == 0);
if (maxFuncletFrameSizeAligned <= 512)
{
unsigned funcletFrameSize = saveRegsPlusPSPSize + compiler->lvaOutgoingArgSpaceSize;
- unsigned funcletFrameSizeAligned = (unsigned)roundUp(funcletFrameSize, STACK_ALIGN);
+ unsigned funcletFrameSizeAligned = roundUp(funcletFrameSize, STACK_ALIGN);
assert(funcletFrameSizeAligned <= maxFuncletFrameSizeAligned);
unsigned funcletFrameAlignmentPad = funcletFrameSizeAligned - funcletFrameSize;
{
CORINFO_CLASS_HANDLE clsHnd = op->AsObj()->gtClass;
opSize = compiler->info.compCompHnd->getClassSize(clsHnd);
- alignment =
- (unsigned)roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
+ alignment = roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
}
else if (op->gtOper == GT_LCL_VAR)
{
if (op2->IsIconHandle(GTF_ICON_CLASS_HDL))
{
CORINFO_CLASS_HANDLE clsHnd = (CORINFO_CLASS_HANDLE)op2->gtIntCon.gtIconVal;
- opSize = (unsigned)roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
- alignment = (unsigned)roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd),
- TARGET_POINTER_SIZE);
+ opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
+ alignment =
+ roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
}
else
{
{
CORINFO_CLASS_HANDLE clsHnd = op->gtArgPlace.gtArgPlaceClsHnd;
assert(clsHnd != 0);
- opSize = (unsigned)roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
- alignment =
- (unsigned)roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
+ opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE);
+ alignment = roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE);
}
else
{
{
// Var is on the stack at entry.
initStkLclCnt +=
- (unsigned)roundUp(compiler->lvaLclSize(varNum), TARGET_POINTER_SIZE) / sizeof(int);
+ roundUp(compiler->lvaLclSize(varNum), TARGET_POINTER_SIZE) / sizeof(int);
}
}
else
{
varDsc->lvMustInit = true;
- initStkLclCnt += (unsigned)roundUp(compiler->lvaLclSize(varNum), TARGET_POINTER_SIZE) / sizeof(int);
+ initStkLclCnt += roundUp(compiler->lvaLclSize(varNum), TARGET_POINTER_SIZE) / sizeof(int);
}
continue;
// If compiler->lvaOutgoingArgSpaceSize is not aligned, we need to align the SP adjustment.
assert(remainingFrameSz > (int)compiler->lvaOutgoingArgSpaceSize);
int spAdjustment2Unaligned = remainingFrameSz - compiler->lvaOutgoingArgSpaceSize;
- int spAdjustment2 = (int)roundUp((size_t)spAdjustment2Unaligned, STACK_ALIGN);
+ int spAdjustment2 = (int)roundUp((unsigned)spAdjustment2Unaligned, STACK_ALIGN);
int alignmentAdjustment2 = spAdjustment2 - spAdjustment2Unaligned;
assert((alignmentAdjustment2 == 0) || (alignmentAdjustment2 == 8));
// If compiler->lvaOutgoingArgSpaceSize is not aligned, we need to align the SP adjustment.
assert(remainingFrameSz > (int)compiler->lvaOutgoingArgSpaceSize);
int spAdjustment2Unaligned = remainingFrameSz - compiler->lvaOutgoingArgSpaceSize;
- int spAdjustment2 = (int)roundUp((size_t)spAdjustment2Unaligned, STACK_ALIGN);
+ int spAdjustment2 = (int)roundUp((unsigned)spAdjustment2Unaligned, STACK_ALIGN);
int alignmentAdjustment2 = spAdjustment2 - spAdjustment2Unaligned;
assert((alignmentAdjustment2 == 0) || (alignmentAdjustment2 == REGSIZE_BYTES));
regNumber zeroReg = genGetZeroReg(initReg, pInitRegZeroed);
// zero out the whole thing rounded up to a single stack slot size
- unsigned lclSize = (unsigned)roundUp(compiler->lvaLclSize(varNum), sizeof(int));
+ unsigned lclSize = roundUp(compiler->lvaLclSize(varNum), (unsigned)sizeof(int));
unsigned i;
for (i = 0; i + REGSIZE_BYTES <= lclSize; i += REGSIZE_BYTES)
{
if (source->TypeGet() == TYP_STRUCT)
{
GenTreeObj* obj = source->AsObj();
- unsigned argBytes = (unsigned)roundUp(obj->gtBlkSize, TARGET_POINTER_SIZE);
+ unsigned argBytes = roundUp(obj->gtBlkSize, TARGET_POINTER_SIZE);
assert((curArgTabEntry->numSlots * TARGET_POINTER_SIZE) == argBytes);
}
#endif // FEATURE_PUT_STRUCT_ARG_STK
}
#endif // defined(FEATURE_SIMD) && !defined(_TARGET_64BIT_)
- return (unsigned)(roundUp(lvExactSize, TARGET_POINTER_SIZE));
+ return roundUp(lvExactSize, TARGET_POINTER_SIZE);
}
const size_t lvArgStackSize() const;
fgCurBBEpoch++;
fgCurBBEpochSize = fgBBNumMax + 1;
fgBBSetCountInSizeTUnits =
- unsigned(roundUp(fgCurBBEpochSize, sizeof(size_t) * 8)) / unsigned(sizeof(size_t) * 8);
+ roundUp(fgCurBBEpochSize, (unsigned)(sizeof(size_t) * 8)) / unsigned(sizeof(size_t) * 8);
#ifdef DEBUG
// All BlockSet objects are now invalid!
// static
unsigned AllVarBitSetTraits::GetArrSize(Compiler* comp, unsigned elemSize)
{
- return unsigned(roundUp(GetSize(comp), elemSize));
+ return roundUp(GetSize(comp), elemSize);
}
// static
{
assert(elemSize == sizeof(size_t));
unsigned elemBits = 8 * elemSize;
- return (unsigned)roundUp(b->size, elemBits) / elemBits;
+ return roundUp(b->size, elemBits) / elemBits;
}
// static
#endif // FEATURE_MULTIREG_ARGS
// we pass this struct by value in multiple registers
- return (unsigned)roundUp(structSize, TARGET_POINTER_SIZE);
+ return roundUp(structSize, TARGET_POINTER_SIZE);
}
else
{
unsigned argSize = sizeof(int) * genTypeStSz(argType);
assert(0 < argSize && argSize <= sizeof(__int64));
- return (unsigned)roundUp(argSize, TARGET_POINTER_SIZE);
+ return roundUp(argSize, TARGET_POINTER_SIZE);
}
#endif
}
// stack alignment boundary.
if (compLocallocUsed)
{
- outgoingArgSpaceSize = (unsigned)roundUp(outgoingArgSpaceSize, STACK_ALIGN);
+ outgoingArgSpaceSize = roundUp(outgoingArgSpaceSize, STACK_ALIGN);
JITDUMP("Bumping outgoingArgSpaceSize to %u for localloc", outgoingArgSpaceSize);
}
{
// Get the GC fields info
var_types simdBaseType; // Dummy argument
- slots = (unsigned)(roundUp(size, TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE);
+ slots = roundUp(size, TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE;
gcPtrs = new (this, CMK_ASTNode) BYTE[slots];
nodeType = impNormStructType(structHnd, gcPtrs, &gcPtrCount, &simdBaseType);
}
callsiteSize += 10; // "lea EAX, bword ptr [EBP-14H]"
- unsigned opsz = (unsigned)(roundUp(comp->getClassSize(verType.GetClassHandle()), TARGET_POINTER_SIZE));
+ unsigned opsz = roundUp(comp->getClassSize(verType.GetClassHandle()), TARGET_POINTER_SIZE);
unsigned slots = opsz / TARGET_POINTER_SIZE;
callsiteSize += slots * 20; // "push gword ptr [EAX+offs] "
#endif // _TARGET_XXX_
#if FEATURE_FASTTAILCALL
- varDscInfo->stackArgSize += (unsigned)roundUp(argSize, TARGET_POINTER_SIZE);
+ varDscInfo->stackArgSize += roundUp(argSize, TARGET_POINTER_SIZE);
#endif // FEATURE_FASTTAILCALL
}
// The arg size is returning the number of bytes of the argument. For a struct it could return a size not a
// multiple of TARGET_POINTER_SIZE. The stack allocated space should always be multiple of TARGET_POINTER_SIZE,
// so round it up.
- compArgSize += (unsigned)roundUp(argSize, TARGET_POINTER_SIZE);
+ compArgSize += roundUp(argSize, TARGET_POINTER_SIZE);
#else // !UNIX_AMD64_ABI
compArgSize += argSize;
#endif // !UNIX_AMD64_ABI
// We have a new epoch, and also cache the tracked var count in terms of size_t's sufficient to hold that many bits.
lvaCurEpoch++;
- lvaTrackedCountInSizeTUnits = unsigned(roundUp(lvaTrackedCount, sizeof(size_t) * 8)) / unsigned(sizeof(size_t) * 8);
+ lvaTrackedCountInSizeTUnits =
+ roundUp((unsigned)lvaTrackedCount, (unsigned)(sizeof(size_t) * 8)) / unsigned(sizeof(size_t) * 8);
#ifdef DEBUG
VarSetOps::AssignNoCopy(this, lvaTrackedVars, VarSetOps::MakeFull(this));
#ifdef UNIX_AMD64_ABI
// On the stack frame the homed arg always takes a full number of slots
// for proper stack alignment. Make sure the real struct size is properly rounded up.
- argumentSize = (unsigned)roundUp(argumentSize, TARGET_POINTER_SIZE);
+ argumentSize = roundUp(argumentSize, TARGET_POINTER_SIZE);
#endif // UNIX_AMD64_ABI
argOffs =
if (argOffs < prevRegsSize)
{
// We must align up the argOffset to a multiple of 8 to account for skipped registers.
- argOffs = roundUp(argOffs, 2 * TARGET_POINTER_SIZE);
+ argOffs = roundUp((unsigned)argOffs, 2 * TARGET_POINTER_SIZE);
}
// We should've skipped only a single register.
assert(argOffs == prevRegsSize);
case TYP_DOUBLE:
case TYP_LONG:
// We must align up the argOffset to a multiple of 8
- argOffs = roundUp(argOffsWithoutPreSpillRegArgs, 2 * TARGET_POINTER_SIZE) + sizeofPreSpillRegArgs;
+ argOffs =
+ roundUp((unsigned)argOffsWithoutPreSpillRegArgs, 2 * TARGET_POINTER_SIZE) + sizeofPreSpillRegArgs;
break;
default:
// We need to support alignment requirements to access memory on ARM ARCH
unsigned alignment = 1;
pComp->codeGen->InferOpSizeAlign(lcl, &alignment);
- alignment = (unsigned)roundUp(alignment, TARGET_POINTER_SIZE);
- padding = (unsigned)roundUp(padding, alignment);
+ alignment = roundUp(alignment, TARGET_POINTER_SIZE);
+ padding = roundUp(padding, alignment);
#endif // _TARGET_ARMARCH_
// Change the variable to a TYP_BLK
if (varType != TYP_BLK)
{
- varDsc->lvExactSize = (unsigned)(roundUp(padding + pComp->lvaLclSize(lclNum), TARGET_POINTER_SIZE));
+ varDsc->lvExactSize = roundUp(padding + pComp->lvaLclSize(lclNum), TARGET_POINTER_SIZE);
varDsc->lvType = TYP_BLK;
pComp->lvaSetVarAddrExposed(lclNum);
}
// The compiler memory allocator requires that the allocation be an
// even multiple of int-sized objects
unsigned int varCount = compiler->lvaTrackedCount;
- regMapCount = (unsigned int)roundUp(varCount, sizeof(int));
+ regMapCount = roundUp(varCount, (unsigned)sizeof(int));
// Not sure why blocks aren't numbered from zero, but they don't appear to be.
// So, if we want to index by bbNum we have to know the maximum value.
{
fgArgTabEntry* curArgTabEntry = new (compiler, CMK_fgArgInfo) fgArgTabEntry;
- nextSlotNum = (unsigned)roundUp(nextSlotNum, alignment);
+ nextSlotNum = roundUp(nextSlotNum, alignment);
curArgTabEntry->setRegNum(0, REG_STK);
curArgTabEntry->argNum = argNum;
}
}
- nextSlotNum = (unsigned)roundUp(nextSlotNum, alignment);
+ nextSlotNum = roundUp(nextSlotNum, alignment);
assert(curArgTabEntry->argNum == argNum);
assert(curArgTabEntry->slotNum == nextSlotNum);
}
else
{
- size = (unsigned)(roundUp(info.compCompHnd->getClassSize(argx->gtArgPlace.gtArgPlaceClsHnd),
- TARGET_POINTER_SIZE)) /
+ size = roundUp(info.compCompHnd->getClassSize(argx->gtArgPlace.gtArgPlaceClsHnd),
+ TARGET_POINTER_SIZE) /
TARGET_POINTER_SIZE;
eeGetSystemVAmd64PassStructInRegisterDescriptor(argx->gtArgPlace.gtArgPlaceClsHnd, &structDesc);
if (size > 1)
else
{
// Structs are either passed in 1 or 2 (64-bit) slots
- size = (unsigned)(roundUp(info.compCompHnd->getClassSize(argx->gtArgPlace.gtArgPlaceClsHnd),
- TARGET_POINTER_SIZE)) /
+ size = roundUp(info.compCompHnd->getClassSize(argx->gtArgPlace.gtArgPlaceClsHnd),
+ TARGET_POINTER_SIZE) /
TARGET_POINTER_SIZE;
if (size == 2)
#elif defined(_TARGET_ARM_)
if (isStructArg)
{
- size = (unsigned)(roundUp(info.compCompHnd->getClassSize(argx->gtArgPlace.gtArgPlaceClsHnd),
- TARGET_POINTER_SIZE)) /
+ size = roundUp(info.compCompHnd->getClassSize(argx->gtArgPlace.gtArgPlaceClsHnd),
+ TARGET_POINTER_SIZE) /
TARGET_POINTER_SIZE;
if (isHfaArg || size > 1)
{
if (varTypeIsStruct(argx))
{
size = info.compCompHnd->getClassSize(impGetRefAnyClass());
- unsigned roundupSize = (unsigned)roundUp(size, TARGET_POINTER_SIZE);
+ unsigned roundupSize = roundUp(size, TARGET_POINTER_SIZE);
size = roundupSize / TARGET_POINTER_SIZE;
eeGetSystemVAmd64PassStructInRegisterDescriptor(impGetRefAnyClass(), &structDesc);
}
unsigned originalSize = info.compCompHnd->getClassSize(objClass);
originalSize = (originalSize == 0 ? TARGET_POINTER_SIZE : originalSize);
- unsigned roundupSize = (unsigned)roundUp(originalSize, TARGET_POINTER_SIZE);
+ unsigned roundupSize = roundUp(originalSize, TARGET_POINTER_SIZE);
structSize = originalSize;
// recompute the 'size' so that it represent the number of stack slots rather than the number of
// registers
//
- unsigned roundupSize = (unsigned)roundUp(structSize, TARGET_POINTER_SIZE);
+ unsigned roundupSize = roundUp(structSize, TARGET_POINTER_SIZE);
size = roundupSize / TARGET_POINTER_SIZE;
// We also must update fltArgRegNum so that we no longer try to
{
assert(structSize <= MAX_ARG_REG_COUNT * TARGET_POINTER_SIZE);
BYTE gcPtrs[MAX_ARG_REG_COUNT];
- elemCount = (unsigned)roundUp(structSize, TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE;
+ elemCount = roundUp(structSize, TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE;
info.compCompHnd->getClassGClayout(objClass, &gcPtrs[0]);
for (unsigned inx = 0; inx < elemCount; inx++)
node->gtFlags &= ~(GTF_VAR_USEASG);
break;
}
- unsigned simdSize = (unsigned int)roundUp(varDsc->lvExactSize, TARGET_POINTER_SIZE);
+ unsigned simdSize = roundUp(varDsc->lvExactSize, TARGET_POINTER_SIZE);
node->gtType = comp->getSIMDTypeForSize(simdSize);
#endif // FEATURE_SIMD
}
{
CORINFO_CLASS_HANDLE structHnd = varDsc->lvVerTypeInfo.GetClassHandle();
GenTreeObj* objNode = comp->gtNewObjNode(structHnd, location)->AsObj();
- unsigned int slots = (unsigned)(roundUp(size, TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE);
+ unsigned int slots = roundUp(size, TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE;
objNode->SetGCInfo(varDsc->lvGcLayout, varDsc->lvStructGcCount, slots);
objNode->ChangeOper(GT_STORE_OBJ);