S/390: Define macros for rounding mode constants
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 11 Mar 2016 07:24:41 +0000 (07:24 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 11 Mar 2016 07:24:41 +0000 (07:24 +0000)
commitae8e301e08b084da8e2142aa195135cae718cd70
treeff8ea622f6b57f8864a346ec9013099a62faf4f1
parentdd95128ba97f4b43145d76d6624de52e2cbda074
S/390: Define macros for rounding mode constants

This patch replaces a few magic numbers used for floating point
rounding modes with macros.  This is mostly a NoOp change apart from:

fixuns_truncdddi2, fixuns_trunctddi2, fixuns_trunc<mode>si2: Replace 5
with DFP_RND_TOWARD_0 (which is 9).

5 as well as 9 represent round towards 0 with the difference that for
5 the new DFP quantum exception is enabled as well.  This exception
isn't IEEE754 and we do not have an interface to enable and test it
anyway.  So we do not intend to enable it.  This so far should not
have any noticable effect since the quantum exception was not
observable through the Posix functions.

Some pattern ("fix_trunc<mode>di2") is already using rounding mode 9
correctly.

gcc/ChangeLog:

2016-03-11  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/s390/s390.md (BFP_RND_*, DFP_RND_*): Add new constant
definitions for BFP and DFP rounding modes.
("fixuns_truncdddi2", "fixuns_trunctddi2")
("fixuns_trunc<BFP:mode><GPR:mode>2", "fixuns_trunc<mode>si2")
("fix_trunc<DSF:mode><GPR:mode>2", "fix_trunc<mode>di2")
("fix_trunctf<mode>2"): Use the new constants instead of magic
numbers.

From-SVN: r234133
gcc/ChangeLog
gcc/config/s390/s390.md