S/390: Use proper rounding mode for DFP to BFD conversions
commit18537f76d8d63e502aa58ee44834a22454bf9951
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Sep 2018 10:58:42 +0000 (12 10:58 +0000)
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Sep 2018 10:58:42 +0000 (12 10:58 +0000)
tree943924130bdc7526d1cfc789e2cefae0cb95d32d
parentf91d3a9d733b9985fc02ae62cbc7e6bc7a27417f
S/390: Use proper rounding mode for DFP to BFD conversions

According to IEEE 754 2008 4.3 'Rounding-direction attributes' the
rounding mode of the target format needs to be used. By not setting
the value so far we have always used the DFP rounding mode.

gcc/ChangeLog:

2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/s390.md (PFPO_RND_MODE_DFP, PFPO_RND_MODE_BFP): New
constants.
("trunc<BFP:mode><DFP_ALL:mode>2")
("trunc<DFP_ALL:mode><BFP:mode>2")
("extend<BFP:mode><DFP_ALL:mode>2")
("extend<DFP_ALL:mode><BFP:mode>2"): Set proper rounding mode
according to the target operand type.

gcc/testsuite/ChangeLog:

2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/dfp_to_bfp_rounding.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264234 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/s390/s390.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/dfp_to_bfp_rounding.c [new file with mode: 0644]