aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2012-05-11 17:11:11 +0200
committerUros Bizjak <uros@gcc.gnu.org>2012-05-11 17:11:11 +0200
commitd2b21f206228ea1829a06f19c23d60c159a8d612 (patch)
tree617d103aab75266b8f82f81e5523aaa01ac692b7
parent835c9db01f44e7346c5764f3c7abc654e9faa2e7 (diff)
downloadgcc-d2b21f206228ea1829a06f19c23d60c159a8d612.zip
gcc-d2b21f206228ea1829a06f19c23d60c159a8d612.tar.gz
gcc-d2b21f206228ea1829a06f19c23d60c159a8d612.tar.bz2
alpha.c (alpha_emit_conditional_branch): Handle ORDERED and UNORDERED conditions.
* config/alpha/alpha.c (alpha_emit_conditional_branch): Handle ORDERED and UNORDERED conditions. From-SVN: r187411
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/alpha/alpha.c28
2 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7da054f..6076af9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/alpha/alpha.c (alpha_emit_conditional_branch): Handle
+ ORDERED and UNORDERED conditions.
+
2012-05-11 Richard Guenther <rguenther@suse.de>
* tree-flow.h (referenced_var_check_and_insert): Remove.
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 174abc2..225c9ab 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -2335,7 +2335,7 @@ alpha_emit_conditional_branch (rtx operands[], enum machine_mode cmp_mode)
{
case EQ: case LE: case LT: case LEU: case LTU:
case UNORDERED:
- /* We have these compares: */
+ /* We have these compares. */
cmp_code = code, branch_code = NE;
break;
@@ -2572,13 +2572,15 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
switch (code)
{
case EQ: case LE: case LT: case LEU: case LTU:
+ case UNORDERED:
/* We have these compares. */
cmp_code = code, code = NE;
break;
case NE:
- /* This must be reversed. */
- cmp_code = EQ, code = EQ;
+ case ORDERED:
+ /* These must be reversed. */
+ cmp_code = reverse_condition (code), code = EQ;
break;
case GE: case GT: case GEU: case GTU:
@@ -2598,6 +2600,14 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
gcc_unreachable ();
}
+ if (cmp_mode == DImode)
+ {
+ if (!reg_or_0_operand (op0, DImode))
+ op0 = force_reg (DImode, op0);
+ if (!reg_or_8bit_operand (op1, DImode))
+ op1 = force_reg (DImode, op1);
+ }
+
tem = gen_reg_rtx (cmp_mode);
emit_insn (gen_rtx_SET (VOIDmode, tem,
gen_rtx_fmt_ee (cmp_code, cmp_mode,
@@ -2609,6 +2619,14 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
local_fast_math = 1;
}
+ if (cmp_mode == DImode)
+ {
+ if (!reg_or_0_operand (op0, DImode))
+ op0 = force_reg (DImode, op0);
+ if (!reg_or_8bit_operand (op1, DImode))
+ op1 = force_reg (DImode, op1);
+ }
+
/* We may be able to use a conditional move directly.
This avoids emitting spurious compares. */
if (signed_comparison_operator (cmp, VOIDmode)
@@ -2627,11 +2645,13 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
switch (code)
{
case EQ: case LE: case LT: case LEU: case LTU:
+ case UNORDERED:
/* We have these compares: */
break;
case NE:
- /* This must be reversed. */
+ case ORDERED:
+ /* These must be reversed. */
code = reverse_condition (code);
cmov_code = EQ;
break;