]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Check -+0 and NaN for smax/smin generation
authorJiufu Guo <guojiufu@linux.ibm.com>
Tue, 10 Mar 2020 05:51:57 +0000 (13:51 +0800)
committerJiufu Guo <guojiufu@linux.ibm.com>
Wed, 11 Mar 2020 01:34:39 +0000 (09:34 +0800)
commit37e0df8a9be5a8232f4ccb73cdadb02121ba523f
tree6e5892773073ca2e3964bc81de76cdd97dc5d98c
parent76743c8a6abbe29fe0f20fc55d5d691ff62dee6a
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.
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/p9-minmax-3.c [new file with mode: 0644]