This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix emit_conditional_add and documentation for add@var{mode}cc
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 3 Sep 2012 13:12:25 +0200
- Subject: Re: [PATCH] Fix emit_conditional_add and documentation for add@var{mode}cc
- References: <CA+=Sn1mCSRRVFFSgKKTuH67QiC7cWf5cuyomZ-cDCkB4t+==CA@mail.gmail.com> <CA+=Sn1nvkkSGc22RxD5L_wq0WutcRZgt7FDQgksV3PdLB8UoxQ@mail.gmail.com>
On Sat, Aug 25, 2012 at 12:43 AM, Andrew Pinski <pinskia@gmail.com> wrote:
> Forgot to attach the patch.
>
> -- Andrew
>
> On Fri, Aug 24, 2012 at 3:42 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>> Hi,
>> I decided to split this patch from the other patch which uses
>> emit_conditional_add in expand as that part of the patch needs some
>> work. This part of the patch can be applied separately and it fixes a
>> few things dealing with conditional adds.
>>
>> First the documentation is wrong for the pattern as we do the addition
>> if operand 0 is true rather than false.
>> Then emit_conditional_add is wrong as you cannot switch around op2 and op3.
>>
>> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
Which does not have conditional add ...
Well, the patch looks ok to me. I suppose the op2 and op3 swapping was
supposed to canonicalize operands, but I see that addcc does not have a separate
argument slot for the value to use when the comparison is false.
Thanks,
Richard.
>> Thanks,
>> Andrew Pinski
>>
>> ChangeLog:
>> * optabs.c (emit_conditional_add): Correct comment about the arguments.
>> Remove code which might swap op2 and op3 since they cannot be swapped.
>> * doc/md.texi (add@var{mode}cc): Fix document about how the arguments are used.