This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Canonicalising truncated shift counts
Eric Botcazou <ebotcazou@libertysurf.fr> writes:
> Did you consider doing this canonicalization in simplify_gen_binary instead,
> where the canonicalization for the commutative case is done?
I don't think that'd be the right approach. It seems odd for
simplify_binary_operand to return null for a pair of operands
if simplify_gen_subreg would keep one operand and change the
value of the other. This canonicalisation seems more in the
spirit of things like
(minus ... (const_int X)) -> (plus ... (const_int -X))
and (mult ... (const_int 2<<X)) -> (ashift ... (const_int X))
(especially the first).
Richard