]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: alpha.c (alpha_emit_conditional_branch): Handle ORDERED and UNORDERED condi...
authorUros Bizjak <ubizjak@gmail.com>
Sun, 13 May 2012 20:12:58 +0000 (22:12 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 13 May 2012 20:12:58 +0000 (22:12 +0200)
Backport from mainline
2012-05-12  Uros Bizjak  <ubizjak@gmail.com>

* config/alpha/alpha.c (alpha_emit_conditional_branch): Handle
ORDERED and UNORDERED conditions.

From-SVN: r187444

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 258b706457db54dd9a5590bb3f5c682336c53cec..b97a5dea3be387268e86b59506cab6706ae1f8ba 100644 (file)
@@ -1,3 +1,11 @@
+2012-05-13  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2012-05-12  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/alpha/alpha.c (alpha_emit_conditional_branch): Handle
+       ORDERED and UNORDERED conditions.
+
 2012-05-06  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR target/52999
index 34ec9674727b19dfda7588b21e7c1f6e12c9c670..2f4873eb6c209d6b20e27c6332f2e3528aa0bdc0 100644 (file)
@@ -2469,7 +2469,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;
 
@@ -2706,13 +2706,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:
@@ -2732,6 +2734,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,
@@ -2743,6 +2753,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)
@@ -2761,11 +2779,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;