Fix arm64 prolog generation for register masks with holes. (dotnet/coreclr#21395)
* Check that `genSaveCalleeSavedRegistersHelp` doesn't accept `REG_LR`.
There are two callers and both save `LR` with `FP` before calling this helper.
In case if somebody calls this function wth`REG_LR` it won't work because unwinding info doesn't expect holes in the reg pairs.
* Extract `genPushOrPopCalleeSavedRegisters`.
It will be used for both float and int types.
* Extend `genSaveCaleeSavedRegisterGroup` to support float.
The previous version was a copy-paste with an additional case for `REG_LR` that was unreachable. Fix that.
* Use `genSaveCaleeSavedRegisterGroup` for floats.
* Extract `genRestoreCaleeSavedRegisterGroup`.
It will be used for both int and float groups.
* Prepare `genPopCalleeSavedRegisters` to work with float.
* Use `genRestoreCaleeSavedRegisterGroup` for float.
* Check that `genRestoreCalleeSavedRegistersHelp` doesn't restore `REG_LR`.
Both callers do it later.
* Extract `CheckSPOffset`.
and move it out of loops because it works only before the first save intruction.
* Format `genRestoreCaleeSavedRegisterGroup` as `genSaveCalleeSavedRegistersHelp`.
* Extract `buildRegPairsStack` from `genSaveCaleeSavedRegisterGroup` and `genRestoreCaleeSavedRegisterGroup`.
Build a stack of registers that we want to save/restore and then iterate over it doing the actual saving/restoring.
* Extract `GetSlotSizeForRegsInMask`.
* Tolerate holes in arm64 prolog/epilog register masks.
Fixes dotnet/coreclr#21363
* Reenable the test.
* Add new methods headers.
* Fix typos.
* Do not use non-const references.
* Describe `buildRegPairsStack` better.
* Change signature of `buildRegPairsStack` to avoid copyings of big structs.
* Return the logic for `RBM_LR`.
For future use.
* Clean-up some unused variables.
* Fix comments.
* Get rid of file-level functions.
* Make new methods static.
Commit migrated from https://github.com/dotnet/coreclr/commit/
a9ceb1534e5a205bc1b56d0c097595ef8c2ff7f6