mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rs6000: Check -+0 and NaN for smax/smin generation
PR93709 mentioned regressions on maxlocval_4.f90 and minlocval_f.f90 which relates to max of '-inf' and 'nan'. This regression occur on P9 because P9 new instruction 'xsmaxcdp' is generated. And for C code `a < b ? b : a` is also generated as `xsmaxcdp` under -O2 for P9. While this instruction behavior more like C/C++ semantic (a>b?a:b). This generates prevents 'xsmaxcdp' to be generated for those cases. 'xsmincdp' also is handled in patch. gcc/ 2020-03-10 Jiufu Guo <guojiufu@linux.ibm.com> PR target/93709 * gcc/config/rs6000/rs6000.c (rs6000_emit_p9_fp_minmax): Check NAN and SIGNED_ZEROR for smax/smin. gcc/testsuite 2020-03-10 Jiufu Guo <guojiufu@linux.ibm.com> PR target/93709 * gcc.target/powerpc/p9-minmax-3.c: New test.
- Loading branch information
Jiufu Guo
committed
Mar 11, 2020
1 parent
76743c8
commit 37e0df8
Showing
4 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* { dg-do compile { target { powerpc*-*-* } } } */ | ||
/* { dg-require-effective-target powerpc_p9vector_ok } */ | ||
/* { dg-options "-mdejagnu-cpu=power9 -O2 -mpower9-minmax" } */ | ||
/* { dg-final { scan-assembler-not "xsmaxcdp" } } */ | ||
/* { dg-final { scan-assembler-not "xsmincdp" } } */ | ||
|
||
double | ||
dbl_max1 (double a, double b) | ||
{ | ||
return a < b ? b : a; | ||
} | ||
|
||
double | ||
dbl_min1 (double a, double b) | ||
{ | ||
return a > b ? b : a; | ||
} |