diff options
author | Dehao Chen <dehao@google.com> | 2014-03-27 00:41:10 +0000 |
---|---|---|
committer | Dehao Chen <dehao@gcc.gnu.org> | 2014-03-27 00:41:10 +0000 |
commit | a0dbf28553c24241b594a21180ffbc28c824b576 (patch) | |
tree | 057ed7df879caae5d8ea22deddf58784f2b9915d /gcc/dojump.c | |
parent | e5d6141d82590e45a87cd3c119a5651b058edc25 (diff) | |
download | gcc-a0dbf28553c24241b594a21180ffbc28c824b576.zip gcc-a0dbf28553c24241b594a21180ffbc28c824b576.tar.gz gcc-a0dbf28553c24241b594a21180ffbc28c824b576.tar.bz2 |
dojump.c (do_compare_rtx_and_jump): Sets correct probability for compiler inserted conditional jumps for NAN float...
* dojump.c (do_compare_rtx_and_jump): Sets correct probability for
compiler inserted conditional jumps for NAN float check.
* gcc.dg/predict-8.c: New test.
From-SVN: r208860
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r-- | gcc/dojump.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c index 7846314..1c3a2be 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -1103,6 +1103,11 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp, else { + int first_prob = prob; + if (first_code == UNORDERED) + first_prob = REG_BR_PROB_BASE / 100; + else if (first_code == ORDERED) + first_prob = REG_BR_PROB_BASE - REG_BR_PROB_BASE / 100; if (and_them) { rtx dest_label; @@ -1116,11 +1121,13 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp, else dest_label = if_false_label; do_compare_rtx_and_jump (op0, op1, first_code, unsignedp, mode, - size, dest_label, NULL_RTX, prob); + size, dest_label, NULL_RTX, + first_prob); } else do_compare_rtx_and_jump (op0, op1, first_code, unsignedp, mode, - size, NULL_RTX, if_true_label, prob); + size, NULL_RTX, if_true_label, + first_prob); } } |