This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/n] Add conditional compare support
- From: Richard Henderson <rth at redhat dot com>
- To: Zhenqiang Chen <zhenqiang dot chen at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, "'Richard Biener'" <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 28 Oct 2013 08:06:41 -0700
- Subject: Re: [PATCH 1/n] Add conditional compare support
- Authentication-results: sourceware.org; auth=none
- References: <000001ce9e58$6dadf230$4909d690$ at arm dot com> <CAFiYyc25hLxrAnsOXbfqYo=Rsw_MDopxb66bygfac-CEsffOEw at mail dot gmail dot com> <521C9406 dot 6050901 at arm dot com> <CAFiYyc0zrBBUvRF0Vmv5PyvypfK75QYuc3D9AMTE+Fkh3nCq4Q at mail dot gmail dot com> <000001ceb453$ceaea3c0$6c0beb40$ at arm dot com> <523AC006 dot 5030706 at arm dot com> <000101ceb829$31ec9040$95c5b0c0$ at arm dot com> <000101cecf0b$148b33a0$3da19ae0$ at arm dot com> <5267F5DE dot 3050109 at redhat dot com> <000001ced090$98563e60$c902bb20$ at arm dot com> <000001ced3b8$4f8dcf60$eea96e20$ at arm dot com>
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~