DBResidueMask() cleanup
Reorder things in this function. Adding 'const' in key places to provide the compiler the extra hint for the purpose of this computation we don't change the value and the value never changes externally even across function calls. I'm sure the compiler (due to macro implementation of TTMaskXxxxx() calls and visibility of data being changes) will optimise the function in exactly the way of the reorder. This also should have the side-effect of making clearer more auto vectorization possibilities to the compiler or potentially replacing the loop with (tail-call or inline) to : simd_TTMaskSetMask_residues(lmask, rmask, TT_TECHDEPBASE, DBNumUserLayers); Which would be a hand optimized form, that probably has an 'l_residues' layout that favours SIMD use (2nd order copy from source of truth just in a different data layout, such as contiguous array of TileTypeBitMask indexed from 0, with the TileType as the index).
This commit is contained in:
parent
d0a6675d45
commit
ff6bcecd9f
|
|
@ -953,24 +953,22 @@ DBFullResidueMask(type, rmask)
|
|||
TileType type;
|
||||
TileTypeBitMask *rmask;
|
||||
{
|
||||
TileType t;
|
||||
TileTypeBitMask *lmask;
|
||||
LayerInfo *li, *lr;
|
||||
|
||||
li = &dbLayerInfo[type];
|
||||
lmask = &li->l_residues;
|
||||
TTMaskZero(rmask);
|
||||
LayerInfo *li = &dbLayerInfo[type];
|
||||
const TileTypeBitMask *lmask = &li->l_residues;
|
||||
|
||||
if (type < DBNumUserLayers)
|
||||
{
|
||||
TTMaskSetMask(rmask, &li->l_residues);
|
||||
TTMaskCopy(rmask, lmask);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (t = TT_TECHDEPBASE; t < DBNumUserLayers; t++)
|
||||
TileType t;
|
||||
const int tt_last = DBNumUserLayers;
|
||||
TTMaskZero(rmask);
|
||||
for (t = TT_TECHDEPBASE; t < tt_last; t++)
|
||||
if (TTMaskHasType(lmask, t))
|
||||
{
|
||||
lr = &dbLayerInfo[t];
|
||||
LayerInfo *lr = &dbLayerInfo[t];
|
||||
TTMaskSetMask(rmask, &lr->l_residues);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue