* [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
@ 2008-09-08 13:32 Tristan Gingold
2008-09-09 15:54 ` Blue Swirl
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Tristan Gingold @ 2008-09-08 13:32 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
Hi,
currently TCGCond are displayed by value in tcg dumps - which is not
very easy to read.
This patch displays names instead.
Tristan.
[-- Attachment #2: q-tcg.diff1 --]
[-- Type: application/octet-stream, Size: 1000 bytes --]
Index: tcg/tcg.c
===================================================================
--- tcg/tcg.c (revision 5181)
+++ tcg/tcg.c (working copy)
@@ -730,6 +730,9 @@
return NULL;
}
+static const char * const cond_name[] =
+{ "eq", "ne", "lt", "ge", "le", "gt", "ltu", "geu", "leu", "gtu" };
+
void tcg_dump_ops(TCGContext *s, FILE *outfile)
{
const uint16_t *opc_ptr;
@@ -841,7 +844,20 @@
fprintf(outfile, "%s",
tcg_get_arg_str_idx(s, buf, sizeof(buf), args[k++]));
}
- for(i = 0; i < nb_cargs; i++) {
+ if (c == INDEX_op_brcond_i32
+#if TCG_TARGET_REG_BITS == 32
+ || c == INDEX_op_brcond2_i32
+#endif
+#if TCG_TARGET_REG_BITS == 64
+ || c == INDEX_op_brcond_i64
+#endif
+ ) {
+ fprintf(outfile, ",%s", cond_name[args[k++]]);
+ i = 1;
+ }
+ else
+ i = 0;
+ for(; i < nb_cargs; i++) {
if (k != 0)
fprintf(outfile, ",");
arg = args[k++];
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
2008-09-08 13:32 [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper Tristan Gingold
@ 2008-09-09 15:54 ` Blue Swirl
2008-09-09 17:00 ` Paul Brook
2008-09-10 7:58 ` Tristan Gingold
2008-09-14 7:49 ` Blue Swirl
2 siblings, 1 reply; 6+ messages in thread
From: Blue Swirl @ 2008-09-09 15:54 UTC (permalink / raw)
To: qemu-devel
On 9/8/08, Tristan Gingold <gingold@adacore.com> wrote:
> Hi,
>
> currently TCGCond are displayed by value in tcg dumps - which is not very
> easy to read.
> This patch displays names instead.
The brconds look much better with your patch. Anybody mind if I apply this?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
2008-09-09 15:54 ` Blue Swirl
@ 2008-09-09 17:00 ` Paul Brook
2008-09-10 7:45 ` Tristan Gingold
0 siblings, 1 reply; 6+ messages in thread
From: Paul Brook @ 2008-09-09 17:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl
> > currently TCGCond are displayed by value in tcg dumps - which is not
> > very easy to read.
> > This patch displays names instead.
>
> The brconds look much better with your patch. Anybody mind if I apply this?
It's a bit of an ugly hack. However I can't immediately see a cleaner
solution.
> fprintf(outfile, ",%s", cond_name[args[k++]]);
This needs bounds checking in case we generate a bogus condition.
Other than that, ok.
Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
2008-09-09 17:00 ` Paul Brook
@ 2008-09-10 7:45 ` Tristan Gingold
0 siblings, 0 replies; 6+ messages in thread
From: Tristan Gingold @ 2008-09-10 7:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl
On Sep 9, 2008, at 7:00 PM, Paul Brook wrote:
>>> currently TCGCond are displayed by value in tcg dumps - which is
>>> not
>>> very easy to read.
>>> This patch displays names instead.
>>
>> The brconds look much better with your patch. Anybody mind if I
>> apply this?
>
> It's a bit of an ugly hack. However I can't immediately see a cleaner
> solution.
Right. A cleaner solution would be to add a new field in tcg-opc.h
that describe how to print an opcode.
Not sure it is worth however.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
2008-09-08 13:32 [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper Tristan Gingold
2008-09-09 15:54 ` Blue Swirl
@ 2008-09-10 7:58 ` Tristan Gingold
2008-09-14 7:49 ` Blue Swirl
2 siblings, 0 replies; 6+ messages in thread
From: Tristan Gingold @ 2008-09-10 7:58 UTC (permalink / raw)
To: qemu-devel
On Sep 8, 2008, at 3:32 PM, Tristan Gingold wrote:
> Hi,
>
> currently TCGCond are displayed by value in tcg dumps - which is
> not very easy to read.
> This patch displays names instead.
Oops I forgot
Signed-off-by: Tristan Gingold <gingold@adacore.com>
>
> Tristan.
>
>
> <q-tcg.diff1>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
2008-09-08 13:32 [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper Tristan Gingold
2008-09-09 15:54 ` Blue Swirl
2008-09-10 7:58 ` Tristan Gingold
@ 2008-09-14 7:49 ` Blue Swirl
2 siblings, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2008-09-14 7:49 UTC (permalink / raw)
To: qemu-devel
On 9/8/08, Tristan Gingold <gingold@adacore.com> wrote:
> Hi,
>
> currently TCGCond are displayed by value in tcg dumps - which is not very
> easy to read.
> This patch displays names instead.
I added bounds checking that Paul pointed out and applied that version. Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-14 7:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 13:32 [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper Tristan Gingold
2008-09-09 15:54 ` Blue Swirl
2008-09-09 17:00 ` Paul Brook
2008-09-10 7:45 ` Tristan Gingold
2008-09-10 7:58 ` Tristan Gingold
2008-09-14 7:49 ` Blue Swirl
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 NNTP newsgroup(s).