Skip to content

Commit b3218e1

Browse files
committed
Revert "Do not use const regMaskTP& as parameter"
This reverts commit d53b620. By not passing `regMaskTP` using constant reference, there is a small cost we have to pay: Without constant reference: Overall: 1.80% MinOpts: 2.05% FullOpts: 1.62% With constant reference: Overall: 1.74% MinOpts: 1.94% FullOpts: 1.6%
1 parent 78b34fa commit b3218e1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/coreclr/jit/target.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -325,31 +325,31 @@ struct regMaskTP
325325
bool IsRegNumInMask(regNumber reg);
326326
};
327327

328-
static regMaskTP operator^(regMaskTP first, regMaskTP second)
328+
static regMaskTP operator^(const regMaskTP& first, const regMaskTP& second)
329329
{
330330
regMaskTP result(first.getLow() ^ second.getLow());
331331
return result;
332332
}
333333

334-
static regMaskTP operator&(regMaskTP first, regMaskTP second)
334+
static regMaskTP operator&(const regMaskTP& first, const regMaskTP& second)
335335
{
336336
regMaskTP result(first.getLow() & second.getLow());
337337
return result;
338338
}
339339

340-
static regMaskTP operator|(regMaskTP first, regMaskTP second)
340+
static regMaskTP operator|(const regMaskTP& first, const regMaskTP& second)
341341
{
342342
regMaskTP result(first.getLow() | second.getLow());
343343
return result;
344344
}
345345

346-
static regMaskTP& operator|=(regMaskTP& first, regMaskTP second)
346+
static regMaskTP& operator|=(regMaskTP& first, const regMaskTP& second)
347347
{
348348
first = first | second;
349349
return first;
350350
}
351351

352-
static regMaskTP& operator^=(regMaskTP& first, regMaskTP second)
352+
static regMaskTP& operator^=(regMaskTP& first, const regMaskTP& second)
353353
{
354354
first = first ^ second;
355355
return first;
@@ -361,18 +361,18 @@ static regMaskTP& operator^=(regMaskTP& first, const regNumber reg)
361361
return first;
362362
}
363363

364-
static regMaskTP& operator&=(regMaskTP& first, regMaskTP second)
364+
static regMaskTP& operator&=(regMaskTP& first, const regMaskTP& second)
365365
{
366366
first = first & second;
367367
return first;
368368
}
369369

370-
static bool operator==(regMaskTP first, regMaskTP second)
370+
static bool operator==(const regMaskTP& first, const regMaskTP& second)
371371
{
372372
return (first.getLow() == second.getLow());
373373
}
374374

375-
static bool operator!=(regMaskTP first, regMaskTP second)
375+
static bool operator!=(const regMaskTP& first, const regMaskTP& second)
376376
{
377377
return !(first == second);
378378
}
@@ -408,18 +408,18 @@ static regMaskTP& operator<<=(regMaskTP& first, const int b)
408408
}
409409
#endif
410410

411-
static regMaskTP operator~(regMaskTP first)
411+
static regMaskTP operator~(const regMaskTP& first)
412412
{
413413
regMaskTP result(~first.getLow());
414414
return result;
415415
}
416416

417-
static uint32_t PopCount(regMaskTP value)
417+
static uint32_t PopCount(const regMaskTP& value)
418418
{
419419
return BitOperations::PopCount(value.getLow());
420420
}
421421

422-
static uint32_t BitScanForward(regMaskTP mask)
422+
static uint32_t BitScanForward(const regMaskTP& mask)
423423
{
424424
return BitOperations::BitScanForward(mask.getLow());
425425
}

0 commit comments

Comments
 (0)