[PowerPC][LLD] Extend R2 save stub to support offsets of more than 26 bits
The R2 save stub will now support offsets up to 64 bits.
There are three cases that will be used.
- The offset fits in 26 bits.
b <26 bit offset>
- The offset does not fit in 26 bits but fits in 34 bits.
paddi r12, 0, <34 bit offset>, 1 mtctr r12 bctr
- The offset does not fit in 34 bits. Since this is an R2 save stub we can use
the TOC in R2. We are not loading the offset but the actual address we want to
addis r12, r2, <address in TOC lo> ld r12 <address in TOC hi>(r12) mtctr r12 bctr
In case 1) the stub is only 8 bytes while in cases 2) and 3) the stub will be
Reviewed By: MaskRay, sfertile, NeHuang
Differential Revision: https://reviews.llvm.org/D87916