[commit: ghc] master: Invert FP conditions to eliminate the explicit NaN check. (6bb9bc7)
git at git.haskell.org
git at git.haskell.org
Tue Sep 18 17:06:56 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6bb9bc7d3c935dcb77e0700cce28de2c9df646df/ghc
>---------------------------------------------------------------
commit 6bb9bc7d3c935dcb77e0700cce28de2c9df646df
Author: klebinger.andreas at gmx.at <klebinger.andreas at gmx.at>
Date: Tue Sep 18 17:46:38 2018 +0200
Invert FP conditions to eliminate the explicit NaN check.
Summary:
Optimisation: we don't have to test the parity flag if we
know the test has already excluded the unordered case: eg >
and >= test for a zero carry flag, which can only occur for
ordered operands.
By reversing comparisons we can avoid testing the parity
for < and <= as well. This works since:
* If any of the arguments is an NaN CF gets set. Resulting in a false result.
* Since this allows us to rule out NaN we can exchange the arguments and invert the
direction of the arrows.
Test Plan: ci/nofib
Reviewers: carter, bgamari, alpmestan
Reviewed By: alpmestan
Subscribers: alpmestan, simonpj, jmct, rwbarton, thomie
GHC Trac Issues: #15196
Differential Revision: https://phabricator.haskell.org/D4990
>---------------------------------------------------------------
6bb9bc7d3c935dcb77e0700cce28de2c9df646df
compiler/nativeGen/X86/CodeGen.hs | 100 ++++++++++++++++-----
testsuite/tests/codeGen/should_compile/Makefile | 3 +
testsuite/tests/codeGen/should_compile/T15196.hs | 4 +
.../tests/codeGen/should_compile/T15196.stdout | 1 +
testsuite/tests/codeGen/should_compile/all.T | 6 ++
5 files changed, 92 insertions(+), 22 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6bb9bc7d3c935dcb77e0700cce28de2c9df646df
More information about the ghc-commits
mailing list