This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR30957
- From: Revital1 Eres <ERES at il dot ibm dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, rakdver at atrey dot karlin dot mff dot cuni dot cz
- Date: Sun, 22 Apr 2007 10:31:50 +0300
- Subject: Re: [PATCH] Fix PR30957
>
> You're not explaining in the code why this non-obvious -0.0 intialization
> is necessary. Add comments please!
>
> Also, what if SOMETHING is +zero now? Is (-zero) + (+zero) == +zero?
>
Yes, the result is +zero in that case as far as I can tell. As I see
it, initializing the expansions with -0.0 will neutralize sign of the
the expansions.
(-zero)+(-zero) = (-zero)
(-zero)+(+zero) = (+zero)
(-zero)-(+zero) = (-zero)
(-zero)-(-zero) = (+zero)
If I understand correctly this is also the reason that in altivec the
madd instruction is initialized with a -0.0 vector when using it as
multiply.
Thanks,
Revital
> Gr.
> Steven