On Mon, 2012-12-10 at 11:22 -0800, Richard Henderson wrote: > On 12/10/2012 01:50 AM, Andreas Krebbel wrote: > > Ok. Here is an updated version trying to address the comments above. > > > > 2012-12-10 Andreas Krebbel <andreas.kreb...@de.ibm.com> > > > > * target.def: Define canonicalize_comparison hook. > > * targhooks.h (default_canonicalize_comparison): New prototype. > > * targhooks.c (default_canonicalize_comparison): New function. > > * doc/tm.texi: Add documentation for the new target hook. > > * doc/tm.texi.in: Likewise. > > * combine.c (try_combine): Adjust to use the target hook. > > * config/alpha/alpha.h (CANONICALIZE_COMPARISON): Remove macro > > definition. > > * config/alpha/alpha.c (alpha_canonicalize_comparison): New > > function. > > (TARGET_CANONICALIZE_COMPARISON): New macro definition. > > * config/arm/arm-protos.h (arm_canonicalize_comparison): Remove > > prototype. > > * config/arm/arm.c (arm_canonicalize_comparison): Add new > > parameter. > > (TARGET_CANONICALIZE_COMPARISON): New macro definition. > > * config/arm/arm.h (CANONICALIZE_COMPARISON): Remove macro > > definition. > > * config/s390/s390-protos.h (s390_canonicalize_comparison): Remove > > prototype. > > * config/s390/s390.c (s390_canonicalize_comparison): Add new > > parameter. > > (TARGET_CANONICALIZE_COMPARISON): New macro definition. > > * config/s390/s390.h (CANONICALIZE_COMPARISON): Remove macro > > definition. > > * config/sh/sh-protos.h (sh_canonicalize_comparison): Remove > > prototype. > > * config/sh/sh.c (sh_canonicalize_comparison): Add new prototype. New > > function overloading the old one. > > (TARGET_CANONICALIZE_COMPARISON): New macro definition. > > * config/sh/sh.h (CANONICALIZE_COMPARISON): Remove macro > > definition. > > * config/spu/spu.c (spu_canonicalize_comparison): New function. > > (TARGET_CANONICALIZE_COMPARISON): New macro definition. > > * config/spu/spu.h (CANONICALIZE_COMPARISON): Remove macro > > definition. > > Looks ok. Although I thought Oleg was suggesting to not add a wrapper in sh, > but to adjust the users...
No, I wasn't. I was just mentioning the "_1" thing. But yes, you're right. The users should be fixed instead. However .... > > + /* Convenience wrapper for the canonicalize_comparison target hook. > > + Targets hooks cannot use enum rtx_code. */ > > Honestly, for 4.9 we should fix that. Unlike machine_mode which really is > target-specific, rtx_code is not. It's just not defined in the right place. > ... I can do that in the SH code during 4.9 after the issue above has been resolved. Cheers, Oleg