On Aarc64 SHIFT_COUNT_TRUNCATED is only true if SIMD code generation is disabled. This is because the simd instructions can be used for shifting but they do not truncate the shift count.
-----Original Message----- From: Richard Kenner [mailto:ken...@vlsi1.ultra.nyu.edu] Sent: Monday, August 7, 2017 2:02 PM To: pins...@gmail.com Cc: gcc-patches@gcc.gnu.org; Michael Collison <michael.colli...@arm.com>; nd <n...@arm.com> Subject: Re: [PATCH] [Aarch64] Optimize subtract in shift counts > That is simplify: > (SHIFT A (32 - B)) -> (SHIFT A (AND (NEG B) 31)) etc. I think you need SHIFT_COUNT_TRUNCATED to be true for this to be valid, but this is exactly what I was getting at in my last message.