Commit ab6d55ef by Steven Bosscher

sched-vis.c (print_exp): Handle FMA explicitly.

	* sched-vis.c (print_exp): Handle FMA explicitly.  Simplify handling
	of RTX_UNARY function-like operations.  Print unknown expression
	RTX classes as pseudo-functions.
	(print_pattern): Simplify return pattern printing.
	(dump_insn_slim): Print the value of notes as a pattern for proper
	printing of CFA notes.

From-SVN: r190016
parent aa36f90b
2012-07-31 Steven Bosscher <steven@gcc.gnu.org>
* sched-vis.c (print_exp): Handle FMA explicitly. Simplify handling
of RTX_UNARY function-like operations. Print unknown expression
RTX classes as pseudo-functions.
(print_pattern): Simplify return pattern printing.
(dump_insn_slim): Print the value of notes as a pattern for proper
printing of CFA notes.
2012-07-31 Dehao Chen <dehao@google.com> 2012-07-31 Dehao Chen <dehao@google.com>
* predict.c (tree_estimate_probability_driver): Normalize the * predict.c (tree_estimate_probability_driver): Normalize the
......
...@@ -114,6 +114,15 @@ print_exp (char *buf, const_rtx x, int verbose) ...@@ -114,6 +114,15 @@ print_exp (char *buf, const_rtx x, int verbose)
st[0] = "-"; st[0] = "-";
op[0] = XEXP (x, 0); op[0] = XEXP (x, 0);
break; break;
case FMA:
st[0] = "{";
op[0] = XEXP (x, 0);
st[1] = "*";
op[1] = XEXP (x, 1);
st[2] = "+";
op[2] = XEXP (x, 2);
st[3] = "}";
break;
case MULT: case MULT:
op[0] = XEXP (x, 0); op[0] = XEXP (x, 0);
st[1] = "*"; st[1] = "*";
...@@ -203,46 +212,14 @@ print_exp (char *buf, const_rtx x, int verbose) ...@@ -203,46 +212,14 @@ print_exp (char *buf, const_rtx x, int verbose)
st[1] = ">->"; st[1] = ">->";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case ABS:
fun = "abs";
op[0] = XEXP (x, 0);
break;
case SQRT:
fun = "sqrt";
op[0] = XEXP (x, 0);
break;
case FFS:
fun = "ffs";
op[0] = XEXP (x, 0);
break;
case EQ:
op[0] = XEXP (x, 0);
st[1] = "==";
op[1] = XEXP (x, 1);
break;
case NE: case NE:
op[0] = XEXP (x, 0); op[0] = XEXP (x, 0);
st[1] = "!="; st[1] = "!=";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case GT: case EQ:
op[0] = XEXP (x, 0);
st[1] = ">";
op[1] = XEXP (x, 1);
break;
case GTU:
fun = "gtu";
op[0] = XEXP (x, 0);
op[1] = XEXP (x, 1);
break;
case LT:
op[0] = XEXP (x, 0);
st[1] = "<";
op[1] = XEXP (x, 1);
break;
case LTU:
fun = "ltu";
op[0] = XEXP (x, 0); op[0] = XEXP (x, 0);
st[1] = "==";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case GE: case GE:
...@@ -250,9 +227,9 @@ print_exp (char *buf, const_rtx x, int verbose) ...@@ -250,9 +227,9 @@ print_exp (char *buf, const_rtx x, int verbose)
st[1] = ">="; st[1] = ">=";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case GEU: case GT:
fun = "geu";
op[0] = XEXP (x, 0); op[0] = XEXP (x, 0);
st[1] = ">";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case LE: case LE:
...@@ -260,9 +237,9 @@ print_exp (char *buf, const_rtx x, int verbose) ...@@ -260,9 +237,9 @@ print_exp (char *buf, const_rtx x, int verbose)
st[1] = "<="; st[1] = "<=";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case LEU: case LT:
fun = "leu";
op[0] = XEXP (x, 0); op[0] = XEXP (x, 0);
st[1] = "<";
op[1] = XEXP (x, 1); op[1] = XEXP (x, 1);
break; break;
case SIGN_EXTRACT: case SIGN_EXTRACT:
...@@ -390,8 +367,33 @@ print_exp (char *buf, const_rtx x, int verbose) ...@@ -390,8 +367,33 @@ print_exp (char *buf, const_rtx x, int verbose)
} }
break; break;
default: default:
/* If (verbose) debug_rtx (x); */ {
/* Most unhandled codes can be printed as pseudo-functions. */
if (GET_RTX_CLASS (GET_CODE (x)) == RTX_UNARY)
{
fun = GET_RTX_NAME (GET_CODE (x));
op[0] = XEXP (x, 0);
}
else if (GET_RTX_CLASS (GET_CODE (x)) == RTX_COMPARE
|| GET_RTX_CLASS (GET_CODE (x)) == RTX_COMM_COMPARE
|| GET_RTX_CLASS (GET_CODE (x)) == RTX_BIN_ARITH
|| GET_RTX_CLASS (GET_CODE (x)) == RTX_COMM_ARITH)
{
fun = GET_RTX_NAME (GET_CODE (x));
op[0] = XEXP (x, 0);
op[1] = XEXP (x, 1);
}
else if (GET_RTX_CLASS (GET_CODE (x)) == RTX_TERNARY)
{
fun = GET_RTX_NAME (GET_CODE (x));
op[0] = XEXP (x, 0);
op[1] = XEXP (x, 1);
op[2] = XEXP (x, 2);
}
else
/* Give up, just print the RTX name. */
st[0] = GET_RTX_NAME (GET_CODE (x)); st[0] = GET_RTX_NAME (GET_CODE (x));
}
break; break;
} }
...@@ -559,10 +561,9 @@ print_pattern (char *buf, const_rtx x, int verbose) ...@@ -559,10 +561,9 @@ print_pattern (char *buf, const_rtx x, int verbose)
sprintf (buf, "%s=%s", t1, t2); sprintf (buf, "%s=%s", t1, t2);
break; break;
case RETURN: case RETURN:
sprintf (buf, "return");
break;
case SIMPLE_RETURN: case SIMPLE_RETURN:
sprintf (buf, "simple_return"); case EH_RETURN:
sprintf (buf, GET_RTX_NAME (GET_CODE (x)));
break; break;
case CALL: case CALL:
print_exp (buf, x, verbose); print_exp (buf, x, verbose);
...@@ -774,7 +775,7 @@ dump_insn_slim (FILE *f, const_rtx x) ...@@ -774,7 +775,7 @@ dump_insn_slim (FILE *f, const_rtx x)
for (note = REG_NOTES (x); note; note = XEXP (note, 1)) for (note = REG_NOTES (x); note; note = XEXP (note, 1))
{ {
fputs (print_rtx_head, f); fputs (print_rtx_head, f);
print_value (t, XEXP (note, 0), 1); print_pattern (t, XEXP (note, 0), 1);
fprintf (f, " %s: %s\n", fprintf (f, " %s: %s\n",
GET_REG_NOTE_NAME (REG_NOTE_KIND (note)), t); GET_REG_NOTE_NAME (REG_NOTE_KIND (note)), t);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment