On 10/28/2013 01:32 AM, Zhenqiang Chen wrote: > Patch is updated according to your comments. Main changes are: > * Add two hooks: legitimize_cmp_combination and legitimize_ccmp_combination > * Improve document.
No, these are not the hooks I proposed. You should *not* have a ccmp_optab, because the middle-end has absolutely no idea what mode TARGET should be in. The hook needs to return an rtx expression appropriate for feeding to cbranch et al. E.g. for arm, (ne (reg:CC_Z CC_REGNUM) (const_int 0)) after having emitted the instruction that sets CC_REGNUM. We need to push this to the backend because for ia64 the expression needs to be of te form (ne (reg:BI new_pseudo) (const_int 0)) r~