*** empty log message ***
authorRichard Stallman <rms@gnu.org>
Thu, 23 Jan 1992 19:10:22 +0000 (19:10 +0000)
committerRichard Stallman <rms@gnu.org>
Thu, 23 Jan 1992 19:10:22 +0000 (19:10 +0000)
From-SVN: r234

gcc/config/i860/i860.md

index 8b4ab42..debb179 100644 (file)
 \f
 ;; Generation of conditionals.
 
-;; The first step is the emission of a standard-looking compare insn.
-;; Then a standard-named conditional branch pattern is run.
-;; That branch pattern looks back at the compare insn and deletes it.
-;; It then emits a machine-specific compare insn and a branch-if-true
-;; or a branch-if-false.
+;; We save the compare operands in the cmpxx patterns and use then when
+;; we generate the branch.
 
-;; These patterns have `abort' because they are supposed to be deleted
-;; in that fashion.
-
-(define_insn "cmpsi"
+(define_expand "cmpsi"
   [(set (cc0) (compare (match_operand:SI 0 "register_operand" "")
                       (match_operand:SI 1 "compare_operand" "")))]
   ""
-  "* abort ();")
+  "
+{ i860_compare_op0 = operands[0];
+  i860_compare_op1 = operands[1];
+  DONE;
+}")
 
-(define_insn "cmpsf"
+(define_expand "cmpsf"
   [(set (cc0) (compare (match_operand:SF 0 "register_operand" "")
                       (match_operand:SF 1 "register_operand" "")))]
   ""
-  "* abort ();")
+  "
+{ i860_compare_op0 = operands[0];
+  i860_compare_op1 = operands[1];
+  DONE;
+}")
 
-(define_insn "cmpdf"
+(define_expand "cmpdf"
   [(set (cc0) (compare (match_operand:DF 0 "register_operand" "")
                       (match_operand:DF 1 "register_operand" "")))]
   ""
-  "* abort ();")
+  "
+{ i860_compare_op0 = operands[0];
+  i860_compare_op1 = operands[1];
+  DONE;
+}")
 
 ;; These are the standard-named conditional branch patterns.
 ;; Detailed comments are found in the first one only.
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  /* Get out of the sequence just started for us.  */
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  /* Examine the preceding compare insn, and get rid of it.  */
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-
-  /* Now once again start a sequence for our new instructions.  */
-
-  start_sequence ();
-
   /* Emit a single-condition compare insn according to
      the type of operands and the condition to be tested.  */
 
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpeqsi (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpsf)
-    emit_insn (gen_cmpeqsf (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpdf)
-    emit_insn (gen_cmpeqdf (recog_operand[0], recog_operand[1]));
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) == MODE_INT)
+    emit_insn (gen_cmpeqsi (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == SFmode)
+    emit_insn (gen_cmpeqsf (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == DFmode)
+    emit_insn (gen_cmpeqdf (i860_compare_op0, i860_compare_op1));
   else
     abort ();
 
   /* Emit branch-if-true.  */
 
-  emit_jump_insn (gen_flipped_inverse_cbranch (label));
-
+  emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
   DONE;
 }")
 
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpeqsi (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpsf)
-    emit_insn (gen_cmpeqsf (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpdf)
-    emit_insn (gen_cmpeqdf (recog_operand[0], recog_operand[1]));
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) == MODE_INT)
+    emit_insn (gen_cmpeqsi (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == SFmode)
+    emit_insn (gen_cmpeqsf (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == DFmode)
+    emit_insn (gen_cmpeqdf (i860_compare_op0, i860_compare_op1));
   else
     abort ();
-  emit_jump_insn (gen_flipped_cbranch (label));
+
+  emit_jump_insn (gen_flipped_cbranch (operands[0]));
 
   DONE;
 }")
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpgtsi (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpsf)
-    emit_insn (gen_cmpgtsf (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpdf)
-    emit_insn (gen_cmpgtdf (recog_operand[0], recog_operand[1]));
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) == MODE_INT)
+    emit_insn (gen_cmpgtsi (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == SFmode)
+    emit_insn (gen_cmpgtsf (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == DFmode)
+    emit_insn (gen_cmpgtdf (i860_compare_op0, i860_compare_op1));
   else
     abort ();
-  emit_jump_insn (gen_flipped_inverse_cbranch (label));
+
+  emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
   DONE;
 }")
 
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpltsi (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpsf)
-    emit_insn (gen_cmpltsf (recog_operand[0], recog_operand[1]));
-  else if (code == CODE_FOR_cmpdf)
-    emit_insn (gen_cmpltdf (recog_operand[0], recog_operand[1]));
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) == MODE_INT)
+    emit_insn (gen_cmpltsi (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == SFmode)
+    emit_insn (gen_cmpltsf (i860_compare_op0, i860_compare_op1));
+  else if (GET_MODE (i860_compare_op0) == DFmode)
+    emit_insn (gen_cmpltdf (i860_compare_op0, i860_compare_op1));
   else
     abort ();
-  emit_jump_insn (gen_flipped_inverse_cbranch (label));
+
+  emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
   DONE;
 }")
 
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) == MODE_INT)
     {
-      emit_insn (gen_cmpgtsi (recog_operand[0], recog_operand[1]));
-      emit_jump_insn (gen_flipped_cbranch (label));
+      emit_insn (gen_cmpgtsi (i860_compare_op0, i860_compare_op1));
+      emit_jump_insn (gen_flipped_cbranch (operands[0]));
     }
   else
     {
-      if (code == CODE_FOR_cmpsf)
-       emit_insn (gen_cmplesf (recog_operand[0], recog_operand[1]));
-      else if (code == CODE_FOR_cmpdf)
-       emit_insn (gen_cmpledf (recog_operand[0], recog_operand[1]));
+      if (GET_MODE (i860_compare_op0) == SFmode)
+       emit_insn (gen_cmplesf (i860_compare_op0, i860_compare_op1));
+      else if (GET_MODE (i860_compare_op0) == DFmode)
+       emit_insn (gen_cmpledf (i860_compare_op0, i860_compare_op1));
       else
        abort ();
-      emit_jump_insn (gen_flipped_inverse_cbranch (label));
+      emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
     }
   DONE;
 }")
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) == MODE_INT)
     {
-      emit_insn (gen_cmpltsi (recog_operand[0], recog_operand[1]));
-      emit_jump_insn (gen_flipped_cbranch (label));
+      emit_insn (gen_cmpltsi (i860_compare_op0, i860_compare_op1));
+      emit_jump_insn (gen_flipped_cbranch (operands[0]));
     }
   else
     {
-      if (code == CODE_FOR_cmpsf)
-       emit_insn (gen_cmpgesf (recog_operand[0], recog_operand[1]));
-      else if (code == CODE_FOR_cmpdf)
-       emit_insn (gen_cmpgedf (recog_operand[0], recog_operand[1]));
+      if (GET_MODE (i860_compare_op0) == SFmode)
+       emit_insn (gen_cmpgesf (i860_compare_op0, i860_compare_op1));
+      else if (GET_MODE (i860_compare_op0) == DFmode)
+       emit_insn (gen_cmpgedf (i860_compare_op0, i860_compare_op1));
       else
-        abort ();
-      emit_jump_insn (gen_flipped_inverse_cbranch (label));
+       abort ();
+      emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
     }
   DONE;
 }")
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpleusi (recog_operand[0], recog_operand[1]));
-  else
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) != MODE_INT)
     abort ();
-  emit_jump_insn (gen_flipped_cbranch (label));
+
+  emit_insn (gen_cmpleusi (i860_compare_op0, i860_compare_op1));
+  emit_jump_insn (gen_flipped_cbranch (operands[0]));
   DONE;
 }")
 
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpgeusi (recog_operand[0], recog_operand[1]));
-  else
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) != MODE_INT)
     abort ();
-  emit_jump_insn (gen_flipped_cbranch (label));
+
+  emit_insn (gen_cmpgeusi (i860_compare_op0, i860_compare_op1));
+  emit_jump_insn (gen_flipped_cbranch (operands[0]));
   DONE;
 }")
 
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpgeusi (recog_operand[0], recog_operand[1]));
-  else
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) != MODE_INT)
     abort ();
-  emit_jump_insn (gen_flipped_inverse_cbranch (label));
+
+  emit_insn (gen_cmpgeusi (i860_compare_op0, i860_compare_op1));
+  emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
   DONE;
 }")
 
   ""
   "
 {
-  rtx label = operands[0];
-  enum insn_code code;
-  rtx prev;
-
-  end_sequence ();
-  prev = get_last_insn ();
-
-  code = recog_memoized (prev);
-  insn_extract (prev);
-  NEXT_INSN (PREV_INSN (prev)) = 0;
-  set_last_insn (PREV_INSN (prev));
-  start_sequence ();
-
-  if (code == CODE_FOR_cmpsi)
-    emit_insn (gen_cmpleusi (recog_operand[0], recog_operand[1]));
-  else
+  if (GET_MODE_CLASS (GET_MODE (i860_compare_op0)) != MODE_INT)
     abort ();
-  emit_jump_insn (gen_flipped_inverse_cbranch (label));
+
+  emit_insn (gen_cmpleusi (i860_compare_op0, i860_compare_op1));
+  emit_jump_insn (gen_flipped_inverse_cbranch (operands[0]));
   DONE;
 }")
 \f
 
 (define_insn "addsi3"
   [(set (match_operand:SI 0 "register_operand" "=r,*f")
-       (plus:SI (match_operand:SI 1 "nonmemory_operand" "%r,!*f")
-                (match_operand:SI 2 "arith_operand" "rI,!*f")))]
+       (plus:SI (match_operand:SI 1 "nonmemory_operand" "%r,*f")
+                (match_operand:SI 2 "arith_operand" "rI,*f")))]
   ""
   "*
 {
 
 (define_insn "subsi3"
   [(set (match_operand:SI 0 "register_operand" "=r,r,*f")
-       (minus:SI (match_operand:SI 1 "register_operand" "r,I,!*f")
-                 (match_operand:SI 2 "arith_operand" "rI,r,!*f")))]
+       (minus:SI (match_operand:SI 1 "register_operand" "r,I,*f")
+                 (match_operand:SI 2 "arith_operand" "rI,r,*f")))]
   ""
   "*
 {