diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2014-09-19 09:17:00 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2014-09-19 09:17:00 +0000 |
commit | feade5a81ff4ff2e63e7570902e9500af7e09e19 (patch) | |
tree | 55b09aa8060dabb209d629ae56ffb614949ca850 | |
parent | db716bdeca770228efaa5fb807079ff22e5e356b (diff) | |
download | gcc-feade5a81ff4ff2e63e7570902e9500af7e09e19.zip gcc-feade5a81ff4ff2e63e7570902e9500af7e09e19.tar.gz gcc-feade5a81ff4ff2e63e7570902e9500af7e09e19.tar.bz2 |
s390.md ("trunctdsd2", [...]): New expanders.
2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.md ("trunctdsd2", "extendsdtd2"): New
expanders.
2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.target/s390/dfp-conv1.c: New testcase.
From-SVN: r215382
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 22 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/dfp-conv1.c | 22 |
4 files changed, 53 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f9a32f6..00fbfa1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + * config/s390/s390.md ("trunctdsd2", "extendsdtd2"): New + expanders. + +2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + PR target/62662 * config/s390/s390.c (s390_emit_epilogue): When doing the return address load optimization force s390_optimize_prologue to leave it diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index bcfe8f9..73ac0dc 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -4406,6 +4406,18 @@ [(set_attr "op_type" "RRF") (set_attr "type" "ftruncsd")]) +(define_expand "trunctdsd2" + [(parallel + [(set (match_dup 3) + (float_truncate:DD (match_operand:TD 1 "register_operand" ""))) + (clobber (match_scratch:TD 2 ""))]) + (set (match_operand:SD 0 "register_operand" "") + (float_truncate:SD (match_dup 3)))] + "TARGET_HARD_DFP" +{ + operands[3] = gen_reg_rtx (DDmode); +}) + ; ; extend(sf|df)(df|tf)2 instruction pattern(s). ; @@ -4442,6 +4454,16 @@ [(set_attr "op_type" "RRF") (set_attr "type" "fsimptf")]) +(define_expand "extendsdtd2" + [(set (match_dup 2) + (float_extend:DD (match_operand:SD 1 "register_operand" ""))) + (set (match_operand:TD 0 "register_operand" "") + (float_extend:TD (match_dup 2)))] + "TARGET_HARD_DFP" +{ + operands[2] = gen_reg_rtx (DDmode); +}) + ; Binary Floating Point - load fp integer ; Expanders for: floor, btrunc, round, ceil, and nearbyint diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 083c78b..6a7f110 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-09-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + * gcc.target/s390/dfp-conv1.c: New testcase. + 2014-09-19 Marat Zakirov <m.zakirov@samsung.com> * c-c++-common/asan/red-align-1.c: New test. diff --git a/gcc/testsuite/gcc.target/s390/dfp-conv1.c b/gcc/testsuite/gcc.target/s390/dfp-conv1.c new file mode 100644 index 0000000..3c553a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/dfp-conv1.c @@ -0,0 +1,22 @@ +/* We do not have hardware instructions which do a direct conversion + between the 32 and 128 bit DFP types. But we can easily do it in + two steps. Older libdfp implementations require this not to call + into a lib in order to prevent an endless loop. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z10 -mzarch" } */ + +_Decimal32 +foo (_Decimal128 a) +{ + return (_Decimal32)a; +} + +_Decimal128 +bar (_Decimal32 a) +{ + return (_Decimal128)a; +} + +/* Make sure no library call is emitted. */ +/* { dg-final { scan-assembler-not "brasl" } } */ |