Skip to content

Commit

Permalink
Add operator[]
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak committed May 30, 2024
1 parent b2d9b1c commit 687ed43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/coreclr/jit/regMaskTPOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,14 @@ void regMaskTP::operator^=(const regNumber reg)
low ^= value;
#endif
}

SingleTypeRegSet regMaskTP::operator[](int index) const
{
#ifdef HAS_MORE_THAN_64_REGISTERS
assert(index <= 2);
RegSet32 value = _registers[index];
return decodeForRegisterIndex(index, value);
#else
return low;
#endif
}
1 change: 1 addition & 0 deletions src/coreclr/jit/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ struct regMaskTP

void operator|=(const regNumber reg);
void operator^=(const regNumber reg);
SingleTypeRegSet operator[](int index) const;
};

static regMaskTP operator^(const regMaskTP& first, const regMaskTP& second)
Expand Down

0 comments on commit 687ed43

Please sign in to comment.