Skip to content

Commit 6ffccb3

Browse files
committed
Make high only to arm64
1 parent fed5c2a commit 6ffccb3

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/coreclr/jit/lsrabuild.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -2825,20 +2825,26 @@ void LinearScan::buildIntervals()
28252825
availableRegCount = REG_INT_COUNT;
28262826
}
28272827

2828+
#ifdef HAS_MORE_THAN_64_REGISTERS
28282829
static_assert(sizeof(regMaskTP) == 2 * sizeof(regMaskSmall));
2830+
#else
2831+
static_assert(sizeof(regMaskTP) == sizeof(regMaskSmall));
2832+
#endif
28292833

28302834
if (availableRegCount < (sizeof(regMaskSmall) * 8))
28312835
{
28322836
// Mask out the bits that are between (8 * regMaskSmall) ~ availableRegCount
28332837
actualRegistersMask = regMaskTP((1ULL << availableRegCount) - 1);
28342838
}
2839+
#ifdef HAS_MORE_THAN_64_REGISTERS
28352840
else if (availableRegCount < (sizeof(regMaskTP) * 8))
28362841
{
28372842
// Mask out the bits that are between (8 * regMaskTP) ~ availableRegCount
28382843
// Subtract one extra for stack.
28392844
unsigned topRegCount = availableRegCount - sizeof(regMaskSmall) * 8 - 1;
28402845
actualRegistersMask = regMaskTP(~RBM_NONE, (1ULL << topRegCount) - 1);
28412846
}
2847+
#endif
28422848
else
28432849
{
28442850
actualRegistersMask = regMaskTP(~RBM_NONE, ~RBM_NONE);

src/coreclr/jit/target.h

+11
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,31 @@ typedef uint64_t regMaskSmall;
229229
#define REG_MASK_ALL_FMT "%016llX"
230230
#endif
231231

232+
#ifdef TARGET_ARM64
233+
#define HAS_MORE_THAN_64_REGISTERS 1
234+
#define MORE_THAN_64_REGISTERS(x) x
235+
#else
236+
#define MORE_THAN_64_REGISTERS(x)
237+
#endif // TARGET_ARM64
238+
232239
typedef regMaskSmall SingleTypeRegSet;
233240
inline SingleTypeRegSet genSingleTypeRegMask(regNumber reg);
234241

235242
struct regMaskTP
236243
{
237244
private:
238245
regMaskSmall low;
246+
#ifdef HAS_MORE_THAN_64_REGISTERS
239247
regMaskSmall high;
248+
#endif
240249

241250
public:
242251

243252
regMaskTP(regMaskSmall lowMask, regMaskSmall highMask)
244253
: low(lowMask)
254+
#ifdef HAS_MORE_THAN_64_REGISTERS
245255
, high(highMask)
256+
#endif
246257
{
247258
}
248259

0 commit comments

Comments
 (0)