This patch refactor how to apply the R_AARCH64_LDST{8,16,32,64,128}_ABS_NC
relocations by adding a new function to correct extract the bits expected
by each relocation. This make is explicit which are the bits range expected
and simplify the code to mask and shift the deriable values.
It also fixes the R_AARCH64_LDST128_ABS_LO12_NC mask, although in pratice
the mask/shift always returns a 16 bytes aligned value.
Checked on AArch64 and with test-suite.
Maybe we should add this to llvm/Support/MathExtras.h? We have a bunch of bit manipulation functions there.
I don't see a reason to make it a template. Start and End can be passed as arguments.
Please run clang-format-diff to format in the LLVM style.
You don't need a parentheses around (End + 1) because End - Start + 1 is the same as (End + 1) - Start.