This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]