[PATCH][optabs][ifcvt][1/3] Define negcc, notcc optabs

Kyrill Tkachov kyrylo.tkachov@arm.com
Tue Sep 1 15:04:00 GMT 2015

Hi all,

This first patch introduces the negcc and notcc optabs that should expand to a conditional
negate or a conditional bitwise complement operation.

These are used in ifcvt.c to transform code of the form:
if (test) x = -A; else x = A;
x = A; if (test) x = -x;
where the "if (test) x = -x;" is implemented using the negcc (or notcc in the ~x case)
if such an optab is available. If such an optab is not implemented then no transformation
is performed.  Thus, without patches 2/3 and 3/3 this patch does not impact behaviour on any target.

Bootstrapped and tested as part of the series on arm, aarch64, x86_64.

Ok for trunk?


2015-09-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * ifcvt.c (noce_try_inverse_constants): New function.
     (noce_process_if_block): Call it.
     * optabs.h (emit_conditional_neg_or_complement): Declare prototype.
     * optabs.def (negcc_optab, notcc_optab): Declare.
     * optabs.c (emit_conditional_neg_or_complement): New function.
     * doc/tm.texi (Standard Names): Document negcc, notcc names.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: negnotcc-optabs.patch
Type: text/x-patch
Size: 6793 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150901/8f4023f2/attachment.bin>

More information about the Gcc-patches mailing list