From b12ef0803ebfd14f888e926ccd64864e5fa04f82 Mon Sep 17 00:00:00 2001 From: uros Date: Mon, 10 Jun 2013 18:45:02 +0000 Subject: [PATCH 1/1] Backport from mainline 2013-06-10 Uros Bizjak * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use cmp_code to construct REG_EQUAL note. Backport from mainline 2013-06-05 Uros Bizjak * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all GE, GT, GEU and GTU compares, modulo DImode compares with zero. Backport from mainline 2013-05-23 Uros Bizjak PR target/57379 * config/alpha/alpha.md (unspec): Add UNSPEC_XFLT_COMPARE. * config/alpha/alpha.c (alpha_emit_xfloating_compare): Construct REG_EQUAL note as UNSPEC_XFLT_COMPARE unspec. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@199902 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 22 ++++++++++++++++++++++ gcc/config/alpha/alpha.c | 21 +++++++++------------ gcc/config/alpha/alpha.md | 1 + 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f74e049046a..82071ffc212 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2013-06-07 Uros Bizjak + + Backport from mainline + 2013-06-10 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use + cmp_code to construct REG_EQUAL note. + + Backport from mainline + 2013-06-05 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all + GE, GT, GEU and GTU compares, modulo DImode compares with zero. + + Backport from mainline + 2013-05-23 Uros Bizjak + + PR target/57379 + * config/alpha/alpha.md (unspec): Add UNSPEC_XFLT_COMPARE. + * config/alpha/alpha.c (alpha_emit_xfloating_compare): Construct + REG_EQUAL note as UNSPEC_XFLT_COMPARE unspec. + 2013-06-09 Jakub Jelinek PR target/57568 diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index f27c08a8cf8..388e77d977e 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -2658,12 +2658,12 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode) break; case GE: case GT: case GEU: case GTU: - /* These must be swapped. */ - if (op1 != CONST0_RTX (cmp_mode)) - { - code = swap_condition (code); - tem = op0, op0 = op1, op1 = tem; - } + /* These normally need swapping, but for integer zero we have + special patterns that recognize swapped operands. */ + if (cmp_mode == DImode && op1 == const0_rtx) + break; + code = swap_condition (code); + tem = op0, op0 = op1, op1 = tem; break; default: @@ -3025,12 +3025,9 @@ alpha_emit_xfloating_compare (enum rtx_code *pcode, rtx op0, rtx op1) operands[1] = op1; out = gen_reg_rtx (DImode); - /* What's actually returned is -1,0,1, not a proper boolean value, - so use an EXPR_LIST as with a generic libcall instead of a - comparison type expression. */ - note = gen_rtx_EXPR_LIST (VOIDmode, op1, NULL_RTX); - note = gen_rtx_EXPR_LIST (VOIDmode, op0, note); - note = gen_rtx_EXPR_LIST (VOIDmode, func, note); + /* What's actually returned is -1,0,1, not a proper boolean value. */ + note = gen_rtx_fmt_ee (cmp_code, VOIDmode, op0, op1); + note = gen_rtx_UNSPEC (DImode, gen_rtvec (1, note), UNSPEC_XFLT_COMPARE); alpha_emit_xfloating_libcall (func, out, operands, 2, note); return out; diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index e715cc86422..bab04e4e566 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -25,6 +25,7 @@ ;; Uses of UNSPEC in this file: (define_c_enum "unspec" [ + UNSPEC_XFLT_COMPARE UNSPEC_ARG_HOME UNSPEC_LDGP1 UNSPEC_INSXH -- 2.11.0