[AArch64] Implement the isLegalAddressingMode and getScalingFactorCost APIs.