IBM Z: Fix long double <-> DFP conversions
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 17 Feb 2021 13:40:03 +0000 (14:40 +0100)
committerIlya Leoshkevich <iii@linux.ibm.com>
Sat, 20 Feb 2021 00:49:35 +0000 (01:49 +0100)
commitb6e446cb58183557a5a5d87dc866aae9613544f8
tree25bbbd4050ab0c727c726222ee99e18b64892a83
parenta974b8a592e1f131a2b1698582e348666d1e2973
IBM Z: Fix long double <-> DFP conversions

When switching the s390 backend to store long doubles in vector
registers, the patterns for long double <-> DFP conversions were
forgotten.  This did not cause observable problems so far, because
libdfp calls are emitted instead of pfpo.  However, when building
libdfp itself, this leads to infinite recursion.

gcc/ChangeLog:

PR target/99134
* config/s390/vector.md (trunctf<DFP_ALL:mode>2_vr): New
pattern.
(trunctf<DFP_ALL:mode>2): Likewise.
(trunctdtf2_vr): Likewise.
(trunctdtf2): Likewise.
(extend<DFP_ALL:mode>tf2_vr): Likewise.
(extend<DFP_ALL:mode>tf2): Likewise.
(extendtftd2_vr): Likewise.
(extendtftd2): Likewise.

gcc/testsuite/ChangeLog:

PR target/99134
* gcc.target/s390/vector/long-double-from-decimal128.c: New test.
* gcc.target/s390/vector/long-double-from-decimal32.c: New test.
* gcc.target/s390/vector/long-double-from-decimal64.c: New test.
* gcc.target/s390/vector/long-double-to-decimal128.c: New test.
* gcc.target/s390/vector/long-double-to-decimal32.c: New test.
* gcc.target/s390/vector/long-double-to-decimal64.c: New test.
gcc/config/s390/vector.md
gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal128.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-from-decimal64.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal128.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/vector/long-double-to-decimal64.c [new file with mode: 0644]