[committed] Improve pretty printing some vector binary ops (PR middle-end/38641)

Jakub Jelinek jakub@redhat.com
Sun Dec 28 00:55:00 GMT 2008


Hi!

Since tuples merge various vector binary operations are dumped
as
lhs = rhs1 <<< ??? >>> rhs2;
This patch dumps them again
as
lhs = VEC_EXTRACT_EVEN_EXPR <rhs1, rhs2>;
Bootstrapped/regtested on x86_64-linux, committed to trunk.

2008-12-27  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/38641
	* gimple-pretty-print.c (dump_binary_rhs): Print
	VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR,
	VEC_PACK_TRUNC_EXPR, VEC_PACK_SAT_EXPR, VEC_PACK_FIX_TRUNC_EXPR,
	VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR
	VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR similarly
	to COMPLEX_EXPR, MIN_EXPR and MAX_EXPR.

--- gcc/gimple-pretty-print.c.jj	2008-10-23 13:21:40.000000000 +0200
+++ gcc/gimple-pretty-print.c	2008-12-27 19:07:20.000000000 +0100
@@ -308,30 +308,29 @@ dump_unary_rhs (pretty_printer *buffer, 
 static void
 dump_binary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
 {
-  switch (gimple_assign_rhs_code (gs))
+  const char *p;
+  enum tree_code code = gimple_assign_rhs_code (gs);
+  switch (code)
     {
     case COMPLEX_EXPR:
-      pp_string (buffer, "COMPLEX_EXPR <");
-      dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
-      pp_string (buffer, ", ");
-      dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
-      pp_string (buffer, ">");
-      break;
-      
     case MIN_EXPR:
-      pp_string (buffer, "MIN_EXPR <");
-      dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
-      pp_string (buffer, ", ");
-      dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
-      pp_string (buffer, ">");
-      break;
-      
     case MAX_EXPR:
-      pp_string (buffer, "MAX_EXPR <");
+    case VEC_WIDEN_MULT_HI_EXPR:
+    case VEC_WIDEN_MULT_LO_EXPR:
+    case VEC_PACK_TRUNC_EXPR:
+    case VEC_PACK_SAT_EXPR:
+    case VEC_PACK_FIX_TRUNC_EXPR:
+    case VEC_EXTRACT_EVEN_EXPR:
+    case VEC_EXTRACT_ODD_EXPR:
+    case VEC_INTERLEAVE_HIGH_EXPR:
+    case VEC_INTERLEAVE_LOW_EXPR:
+      for (p = tree_code_name [(int) code]; *p; p++)
+	pp_character (buffer, TOUPPER (*p));
+      pp_string (buffer, " <");
       dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
       pp_string (buffer, ", ");
       dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
-      pp_string (buffer, ">");
+      pp_character (buffer, '>');
       break;
 
     default:

	Jakub



More information about the Gcc-patches mailing list