public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: A couple of cleanups.
@ 2011-09-15 20:40 Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2011-09-15 20:40 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

Hello!

No functional change.

2011-09-15  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.c (output_fp_compare): Return %v prefixed
	instruction mnemonics for TARGET_AVX.

	* config/i386/i386.md (*movdf_internal_rex64): use cond RTX in
	"type" attribute calculation.
	(*movdf_internal): Ditto.
	(*movsf_internal): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 2998 bytes --]

Index: i386.md
===================================================================
--- i386.md	(revision 178889)
+++ i386.md	(working copy)
@@ -3028,7 +3030,17 @@
       gcc_unreachable();
     }
 }
-  [(set_attr "type" "fmov,fmov,fmov,imov,imov,imov,multi,sselog1,ssemov,ssemov,ssemov,ssemov,ssemov")
+  [(set (attr "type")
+	(cond [(eq_attr "alternative" "0,1,2")
+		 (const_string "fmov")
+	       (eq_attr "alternative" "3,4,5")
+		 (const_string "imov")
+	       (eq_attr "alternative" "6")
+		 (const_string "multi")
+	       (eq_attr "alternative" "7")
+		 (const_string "sselog1")
+	      ]
+	      (const_string "ssemov")))
    (set (attr "modrm")
      (if_then_else
        (and (eq_attr "alternative" "5") (eq_attr "type" "imov"))
@@ -3158,7 +3170,15 @@
      (if_then_else (eq_attr "alternative" "5,6,7,8")
        (const_string "sse2")
        (const_string "*")))
-   (set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov")
+   (set (attr "type")
+	(cond [(eq_attr "alternative" "0,1,2")
+		 (const_string "fmov")
+	       (eq_attr "alternative" "3,4")
+		 (const_string "multi")
+	       (eq_attr "alternative" "5,9")
+		 (const_string "sselog1")
+	      ]
+	      (const_string "ssemov")))
    (set (attr "prefix")
      (if_then_else (eq_attr "alternative" "0,1,2,3,4")
        (const_string "orig")
@@ -3272,7 +3292,17 @@
       gcc_unreachable ();
     }
 }
-  [(set_attr "type" "fmov,fmov,fmov,imov,imov,sselog1,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov,ssemov,ssemov,mmxmov,mmxmov")
+  [(set (attr "type")
+	(cond [(eq_attr "alternative" "0,1,2")
+		 (const_string "fmov")
+	       (eq_attr "alternative" "3,4")
+		 (const_string "multi")
+	       (eq_attr "alternative" "5")
+		 (const_string "sselog1")
+	       (eq_attr "alternative" "9,10,11,14,15")
+		 (const_string "mmxmov")
+	      ]
+	      (const_string "ssemov")))
    (set (attr "prefix")
      (if_then_else (eq_attr "alternative" "5,6,7,8,12,13")
        (const_string "maybe_vex")
Index: i386.c
===================================================================
--- i386.c	(revision 178889)
+++ i386.c	(working copy)
@@ -14900,21 +14900,16 @@ output_fp_compare (rtx insn, rtx *operands, bool e
 
   if (is_sse)
     {
-      static const char ucomiss[] = "vucomiss\t{%1, %0|%0, %1}";
-      static const char ucomisd[] = "vucomisd\t{%1, %0|%0, %1}";
-      static const char comiss[] = "vcomiss\t{%1, %0|%0, %1}";
-      static const char comisd[] = "vcomisd\t{%1, %0|%0, %1}";
-
       if (GET_MODE (operands[0]) == SFmode)
 	if (unordered_p)
-	  return &ucomiss[TARGET_AVX ? 0 : 1];
+	  return "%vucomiss\t{%1, %0|%0, %1}";
 	else
-	  return &comiss[TARGET_AVX ? 0 : 1];
+	  return "%vcomiss\t{%1, %0|%0, %1}";
       else
 	if (unordered_p)
-	  return &ucomisd[TARGET_AVX ? 0 : 1];
+	  return "%vucomisd\t{%1, %0|%0, %1}";
 	else
-	  return &comisd[TARGET_AVX ? 0 : 1];
+	  return "%vcomisd\t{%1, %0|%0, %1}";
     }
 
   gcc_assert (STACK_TOP_P (cmp_op0));

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH, i386]: A couple of cleanups.
@ 2011-10-05 17:42 Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2011-10-05 17:42 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Hello!

No functional change.

2011-10-05  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.c (distance_non_agu_define): Simplify calculation
	of "found".  Simplify return value calculation.
	(distance_agu_use): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32} with shrink-wrapping disabled,
committed to mainline SVN.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 2849 bytes --]

Index: i386.c
===================================================================
--- i386.c	(revision 179558)
+++ i386.c	(working copy)
@@ -16139,19 +16139,20 @@ distance_non_agu_define (unsigned int regno1, unsi
 
 	  FOR_EACH_EDGE (e, ei, bb->preds)
 	    {
-	      int bb_dist = distance_non_agu_define_in_bb (regno1, regno2,
-							   insn, distance,
-							   BB_END (e->src),
-							   &found_in_bb);
+	      int bb_dist
+		= distance_non_agu_define_in_bb (regno1, regno2,
+						 insn, distance,
+						 BB_END (e->src),
+						 &found_in_bb);
 	      if (found_in_bb)
 		{
 		  if (shortest_dist < 0)
 		    shortest_dist = bb_dist;
 		  else if (bb_dist > 0)
 		    shortest_dist = MIN (bb_dist, shortest_dist);
-		}
 
-	      found = found || found_in_bb;
+		  found = true;
+		}
 	    }
 
 	  distance = shortest_dist;
@@ -16164,11 +16165,9 @@ distance_non_agu_define (unsigned int regno1, unsi
   extract_insn_cached (insn);
 
   if (!found)
-    distance = -1;
-  else
-    distance = distance >> 1;
+    return -1;
 
-  return distance;
+  return distance >> 1;
 }
 
 /* Return the distance in half-cycles between INSN and the next
@@ -16181,9 +16180,9 @@ distance_non_agu_define (unsigned int regno1, unsi
    found and false otherwise.  */
 
 static int
-distance_agu_use_in_bb(unsigned int regno,
-		       rtx insn, int distance, rtx start,
-		       bool *found, bool *redefined)
+distance_agu_use_in_bb (unsigned int regno,
+			rtx insn, int distance, rtx start,
+			bool *found, bool *redefined)
 {
   basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL;
   rtx next = start;
@@ -16268,18 +16267,19 @@ distance_agu_use (unsigned int regno0, rtx insn)
 
 	  FOR_EACH_EDGE (e, ei, bb->succs)
 	    {
-	      int bb_dist = distance_agu_use_in_bb (regno0, insn,
-						    distance, BB_HEAD (e->dest),
-						    &found_in_bb, &redefined_in_bb);
+	      int bb_dist
+		= distance_agu_use_in_bb (regno0, insn,
+					  distance, BB_HEAD (e->dest),
+					  &found_in_bb, &redefined_in_bb);
 	      if (found_in_bb)
 		{
 		  if (shortest_dist < 0)
 		    shortest_dist = bb_dist;
 		  else if (bb_dist > 0)
 		    shortest_dist = MIN (bb_dist, shortest_dist);
-		}
 
-	      found = found || found_in_bb;
+		  found = true;
+		}
 	    }
 
 	  distance = shortest_dist;
@@ -16287,11 +16287,9 @@ distance_agu_use (unsigned int regno0, rtx insn)
     }
 
   if (!found || redefined)
-    distance = -1;
-  else
-    distance = distance >> 1;
+    return -1;
 
-  return distance;
+  return distance >> 1;
 }
 
 /* Define this macro to tune LEA priority vs ADD, it take effect when
@@ -16346,7 +16344,7 @@ ix86_lea_outperforms (rtx insn, unsigned int regno
    false otherwise.  */
 
 static bool
-ix86_ok_to_clobber_flags(rtx insn)
+ix86_ok_to_clobber_flags (rtx insn)
 {
   basic_block bb = BLOCK_FOR_INSN (insn);
   df_ref *use;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-05 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15 20:40 [PATCH, i386]: A couple of cleanups Uros Bizjak
2011-10-05 17:42 Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).