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]

[PATCH] Fix PR30957


Hello,

This patch makes MVE to honor signed zero by initializing the variable
expansions with -zero (instead of +zero).

Here is an example to demonstrate this:

 for (i = 0 ; i < n; i++)
     sum += something;

   ==>

   sum += something;
   ....
   i = i+1;
   sum1 += something;
   ....
   i = i+1
   sum2 += something;
   ....


When SUM is initialized with -zero and SOMETHING is also -zero; the
final result of sum should be -zero thus the expansions sum1 and sum2
should be initialized with -zero as well (otherwise we will get +zero
as the final result).

MVE is enabled with -funsafe-math-optimizations and thus should honor
signed zero.  A testcase is also attached.

This patch was bootstrapped and tested on x86.

OK for mainline?

:ADDPATCH middle-end (rtl optimization):

Thanks,
Revital

(See attached file: patch_mve_zero.txt)(See attached file: pr30957-1.c.txt)

Attachment: patch_mve_zero.txt
Description: Text document

Attachment: pr30957-1.c.txt
Description: Text document


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