This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
optimisation for default_print_insn().
- To: matthew green <mrg at cygnus dot com>
- Subject: optimisation for default_print_insn().
- From: Doug Evans <dje at transmeta dot com>
- Date: Mon, 9 Apr 2001 10:56:51 -0700 (PDT)
- Cc: cgen at sources dot redhat dot com, binutils at sources dot redhat dot com
- References: <28258.986813879@cygnus.com>
matthew green writes:
> i've been looking at the cgen generated disassemblers lately
> and i've noticed that it reads target memory twice for the
> initial portion of the instruction. in default_print_insn(),
> there is a call to (*info->read_memory_func)() and then it
> calls print_insn(). the first thing print_insn() does is
> call read_insn() which performs the exact same read_memory_func
> call (same arguments, buffers, etc.) as read_insn() is used
> in other places, i believe the best way to fix this double
> read is to remove the copy in default_print_insn(). i have
> tested this with a couple of ports and nothing appeas to be
> broken.
>
>
> the patch below simply comments the block in
> default_print_insn() rather than removing it entirely. if
> people think it should be removed, i can change my patch.
Assuming your patch goes in, don't use #if 0's.
They just reduce the signal/noise ratio.
[sometimes they're ok, but not in this case]
> OK to commit?
I'd rather not. Studying the code, the comment above print_insn,
and the m32r port makes it seem to me that the read_insn
at the start of print_insn is the duplicate.
Why was it added?