This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ifcvt] Allow CC mode if HAVE_cbranchcc4 (fix s390 build)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: rth at redhat dot com (Richard Henderson)
- Cc: zhenqiang dot chen at arm dot com (Zhenqiang Chen), jbglaw at lug-owl dot de ('Jan-Benedict Glaw'), hpenner at de dot ibm dot com (Hartmut Penner), Andreas dot Krebbel at de dot ibm dot com (Andreas Krebbel), gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Nov 2014 16:33:08 +0100 (CET)
- Subject: Re: [PATCH, ifcvt] Allow CC mode if HAVE_cbranchcc4 (fix s390 build)
- Authentication-results: sourceware.org; auth=none
Richard Henderson wrote:
> On 11/06/2014 05:10 PM, Ulrich Weigand wrote:
> >>> + /* For s390, CC REG is general_operand. But cstorecc4
> >>> only
> >>> + handles CCZ1, which can not handle others like CCU.
> >>> */
> >>> + || GET_MODE_CLASS (GET_MODE (XEXP (cond, 0))) == MODE_CC);
> >>>
> >>
> >> I'd like to know more about this. This seems like a mistake in the backend.
> >
> > We do indeed allow the CC register as general_operand, since it has a
> > register class of CC_REGS.
>
> I rather meant that cstorecc4 only handles some MODE_CC, not that
> CC is a general_operand, that seems questionable.
Well, it's only for CCZ1mode that we can implement cstorecc4 using a simple
"IPM / shift" sequence. In order to handle generic MODE_CC modes, we'd have
to implement a mask check, something like "IPM / shift / load immediate
/ shift / and-immediate". This will usually be slower than then default
branch sequence generated by the middle end.
[ On z196 and more recent machines, we already use LOCR to select one of
two immediates (in registers), generated via the mov<mode>cc expander;
this can handle generic MODE_CC modes. ]
But no matter the rationale, I still don't see what the original problem is;
the pattern describes the mode it can support -- shouldn't this be enough
for the middle end to know whether it is available, without requiring any
further special-case checks?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com