[AArch64] Refactor pre- and post-index merge fuctions into a single function. NFC.