Commit f48f3ede71a43520e0eb71756dc33052aab41837
1 parent
ac41a620
Display TCGCond name in tcg dumper (original patch by Tristan Gingold)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5208 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
30 additions
and
1 deletions
tcg/tcg.c
| @@ -730,6 +730,20 @@ static TCGHelperInfo *tcg_find_helper(TCGContext *s, tcg_target_ulong val) | @@ -730,6 +730,20 @@ static TCGHelperInfo *tcg_find_helper(TCGContext *s, tcg_target_ulong val) | ||
| 730 | return NULL; | 730 | return NULL; |
| 731 | } | 731 | } |
| 732 | 732 | ||
| 733 | +static const char * const cond_name[] = | ||
| 734 | +{ | ||
| 735 | + [TCG_COND_EQ] = "eq", | ||
| 736 | + [TCG_COND_NE] = "ne", | ||
| 737 | + [TCG_COND_LT] = "lt", | ||
| 738 | + [TCG_COND_GE] = "ge", | ||
| 739 | + [TCG_COND_LE] = "le", | ||
| 740 | + [TCG_COND_GT] = "gt", | ||
| 741 | + [TCG_COND_LTU] = "ltu", | ||
| 742 | + [TCG_COND_GEU] = "geu", | ||
| 743 | + [TCG_COND_LEU] = "leu", | ||
| 744 | + [TCG_COND_GTU] = "gtu" | ||
| 745 | +}; | ||
| 746 | + | ||
| 733 | void tcg_dump_ops(TCGContext *s, FILE *outfile) | 747 | void tcg_dump_ops(TCGContext *s, FILE *outfile) |
| 734 | { | 748 | { |
| 735 | const uint16_t *opc_ptr; | 749 | const uint16_t *opc_ptr; |
| @@ -841,7 +855,22 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile) | @@ -841,7 +855,22 @@ void tcg_dump_ops(TCGContext *s, FILE *outfile) | ||
| 841 | fprintf(outfile, "%s", | 855 | fprintf(outfile, "%s", |
| 842 | tcg_get_arg_str_idx(s, buf, sizeof(buf), args[k++])); | 856 | tcg_get_arg_str_idx(s, buf, sizeof(buf), args[k++])); |
| 843 | } | 857 | } |
| 844 | - for(i = 0; i < nb_cargs; i++) { | 858 | + if (c == INDEX_op_brcond_i32 |
| 859 | +#if TCG_TARGET_REG_BITS == 32 | ||
| 860 | + || c == INDEX_op_brcond2_i32 | ||
| 861 | +#elif TCG_TARGET_REG_BITS == 64 | ||
| 862 | + || c == INDEX_op_brcond_i64 | ||
| 863 | +#endif | ||
| 864 | + ) { | ||
| 865 | + if (args[k] < ARRAY_SIZE(cond_name) && cond_name[args[k]]) | ||
| 866 | + fprintf(outfile, ",%s", cond_name[args[k++]]); | ||
| 867 | + else | ||
| 868 | + fprintf(outfile, ",$0x%" TCG_PRIlx, args[k++]); | ||
| 869 | + i = 1; | ||
| 870 | + } | ||
| 871 | + else | ||
| 872 | + i = 0; | ||
| 873 | + for(; i < nb_cargs; i++) { | ||
| 845 | if (k != 0) | 874 | if (k != 0) |
| 846 | fprintf(outfile, ","); | 875 | fprintf(outfile, ","); |
| 847 | arg = args[k++]; | 876 | arg = args[k++]; |