diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 2ef2f9c1e17f1..3003dbf2a60e3 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -44,6 +44,34 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ +#ifdef SWIFT_SUPPORT + regMaskTP rsAllCalleeSavedMask; + regMaskTP rsIntCalleeSavedMask; +#else // !SWIFT_SUPPORT + static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; +#endif // !SWIFT_SUPPORT + +regMaskTP RegSet::rsGetModifiedCalleeSavedRegsMask() const +{ + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & rsAllCalleeSavedMask); +} + +#ifdef TARGET_AMD64 +regMaskTP RegSet::rsGetModifiedOsrIntCalleeSavedRegsMask() const +{ + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & (rsIntCalleeSavedMask | RBM_EBP)); +} +#endif // TARGET_AMD64 + +regMaskTP RegSet::rsGetModifiedIntCalleeSavedRegsMask() const +{ + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & rsIntCalleeSavedMask); +} + //------------------------------------------------------------------------ // verifyRegUsed: verify that the register is marked as used. // diff --git a/src/coreclr/jit/regset.h b/src/coreclr/jit/regset.h index 20b55610594fc..1ca2539f72958 100644 --- a/src/coreclr/jit/regset.h +++ b/src/coreclr/jit/regset.h @@ -74,14 +74,6 @@ class RegSet bool rsModifiedRegsMaskInitialized; // Has rsModifiedRegsMask been initialized? Guards against illegal use. #endif // DEBUG -#ifdef SWIFT_SUPPORT - regMaskTP rsAllCalleeSavedMask; - regMaskTP rsIntCalleeSavedMask; -#else // !SWIFT_SUPPORT - static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // !SWIFT_SUPPORT - public: regMaskTP rsGetModifiedRegsMask() const { @@ -89,24 +81,11 @@ class RegSet return rsModifiedRegsMask; } - regMaskTP rsGetModifiedCalleeSavedRegsMask() const - { - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & rsAllCalleeSavedMask); - } - - regMaskTP rsGetModifiedIntCalleeSavedRegsMask() const - { - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & rsIntCalleeSavedMask); - } + regMaskTP rsGetModifiedCalleeSavedRegsMask() const; + regMaskTP rsGetModifiedIntCalleeSavedRegsMask() const; #ifdef TARGET_AMD64 - regMaskTP rsGetModifiedOsrIntCalleeSavedRegsMask() const - { - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & (rsIntCalleeSavedMask | RBM_EBP)); - } + regMaskTP rsGetModifiedOsrIntCalleeSavedRegsMask() const; #endif // TARGET_AMD64 regMaskTP rsGetModifiedFltCalleeSavedRegsMask() const