re PR tree-optimization/85466 (Performance is slow when doing 'branchless' conditiona...
authorJakub Jelinek <jakub@redhat.com>
Fri, 4 May 2018 07:19:45 +0000 (09:19 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 4 May 2018 07:19:45 +0000 (09:19 +0200)
commit047823853d8324eab7d6ad8f266ee5395c4a76ff
tree577de47e3f2f5746febab4c2403441ef0d8abd9f
parent105073e1cc39fbeb03aa40e294ffc3c400cfa844
re PR tree-optimization/85466 (Performance is slow when doing 'branchless' conditional style math operations)

PR libstdc++/85466
* real.h (real_nextafter): Declare.
* real.c (real_nextafter): New function.
* fold-const-call.c (fold_const_nextafter): New function.
(fold_const_call_sss): Call it for CASE_CFN_NEXTAFTER and
CASE_CFN_NEXTTOWARD.
(fold_const_call_1): For CASE_CFN_NEXTTOWARD call fold_const_call_sss
even when arg1_mode is different from arg0_mode.

* gcc.dg/nextafter-1.c: New test.
* gcc.dg/nextafter-2.c: New test.
* gcc.dg/nextafter-3.c: New test.
* gcc.dg/nextafter-4.c: New test.

From-SVN: r259921
gcc/ChangeLog
gcc/fold-const-call.c
gcc/real.c
gcc/real.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/nextafter-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/nextafter-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/nextafter-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/nextafter-4.c [new file with mode: 0644]