[AArch64] Add RSHRN and RSHRN2 patterns
This adds some tablegen patterns for RSHRN, which performs a rounding shift with narrow. This is similar to the existing SHRN patterns with an extra addition to perform the rounding, that adds 1<<(shift-1) before the right shift. Because the round immediate and the shift amount are tied, it goes via a ComplexPattern that uses a SelectRoundingVLShr method to perform the selection checks. aarch64_neon_rshrn are expanded into the sequence of equivalent instructions (trunc(shr(add(x, 1<<(sht-1)), sht))) so that they can be converted back into RSHRN. Which also allows us to match raddhn through the adjusted patterns that previously used aarch64_neon_rshrn. DIfferential Revision: https://reviews.llvm.org/D140297
parent
63aa57dc
Please register or sign in to comment