This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: why no shortcut operation for comparion on _Complex operands
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: "Bin.Cheng" <amker dot cheng at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 26 Mar 2012 09:27:27 +0200
- Subject: Re: why no shortcut operation for comparion on _Complex operands
- References: <CAHFci28NT8TJNGXR_ASWzf68ytCYdcrHxgoKrMBmBT7bucnLrQ@mail.gmail.com>
On Sun, Mar 25, 2012 at 2:42 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> Hi,
> In tree-complex.c's function expand_complex_comparison, gcc just
> expand comparison on complex
> operands into comparisons on inner type, like:
>
> ?D.5375_17 = REALPART_EXPR <g2>;
> ?D.5376_18 = IMAGPART_EXPR <g2>;
> ?g2.1_5 = COMPLEX_EXPR <D.5375_17, D.5376_18>;
> ?D.5377_19 = REALPART_EXPR <g3>;
> ?D.5378_20 = IMAGPART_EXPR <g3>;
> ?g3.2_6 = COMPLEX_EXPR <D.5377_19, D.5378_20>;
> ?D.5379_21 = D.5375_17 == D.5377_19;
> ?D.5380_22 = D.5376_18 == D.5378_20;
> ?D.5381_23 = D.5379_21 & D.5380_22;
> ?if (D.5381_23 == 1)
> ? ?goto <bb 3>;
> ?else
> ? ?goto <bb 4>;
>
> So is it possible to do shortcut operation for the "&" on the
> real/imag part of complex data?
Sure. Does the RTL expander not do that for your target?
Richard.
> Thanks
>
> --
> Best Regards.