qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] Re: [PATCH 02/17] lm32: translation routines
Date: Mon, 7 Feb 2011 23:00:38 +0100	[thread overview]
Message-ID: <201102072300.38534.michael@walle.cc> (raw)
In-Reply-To: <20110207184125.GB9697@laped.lan>

Hi Edgar.

first of all let me thank you for the review.

On Mon, Feb 07 2011, 19:41:25, Edgar E. Iglesias wrote:
> > +#define JMP_NOJMP    0
> > +#define JMP_DIRECT   1
> > +#define JMP_INDIRECT 2
> 
> These don't seem to be used, can we remove them?
Good catch :) I'll remove them.

> > +
> > +/* This is the state at translation time.  */
> > +typedef struct DisasContext {
> > +    CPUState *env;
> > +    target_ulong pc;
> > +
> > +    /* Decoder.  */
> > +    int format;
> > +    uint32_t ir;
> > +    uint8_t opcode;
> > +    uint8_t r0, r1, r2, csr;
> > +    uint16_t imm5;
> > +    uint16_t imm16;
> > +    uint32_t imm26;
> > +
> > +    unsigned int delayed_branch;
> > +    unsigned int tb_flags, synced_flags; /* tb dependent flags.  */
> > +    int is_jmp;
> > +
> > +    unsigned int jmp;
> > +    uint32_t jmp_pc;
> 
> These too.
Ditto.

> > +
> > +    int nr_nops;
> 
> This should probably go aswell..
See below.

> > +    /* try guessing 'empty' instruction memory, although it may be a
> > valid +     * instruction sequence (eg. srui r0, r0, 0) */
> > +    if (dc->ir) {
> > +        dc->nr_nops = 0;
> > +    } else {
> > +        LOG_DIS("nr_nops=%d\t", dc->nr_nops);
> > +        dc->nr_nops++;
> > +        if (dc->nr_nops > 4) {
> > +            cpu_abort(dc->env, "fetching nop sequence\n");
> > +        }
> > +    }
> 
> This nop sequence detection should probably go away. A reminder for
> me too to remove it from the microblaze port (from where I guess you
> inherited it)..
I've always found this 'feature' handy, esp when you are porting new software. 
Is there any particular reason why this should be removed? Besides the fact 
that it won't match the real hardware if those instructions are executed. In 
the case of the LM32, these are really nonsense instructions (shift r0 right 
by 0, r0 is by definition 0).

-- 
Michael

  reply	other threads:[~2011-02-07 22:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31  0:30 [Qemu-devel] [PATCH 00/17] LatticeMico32 target Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 01/17] LatticeMico32 target support Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 02/17] lm32: translation routines Michael Walle
2011-02-07 18:41   ` [Qemu-devel] " Edgar E. Iglesias
2011-02-07 22:00     ` Michael Walle [this message]
2011-02-07 22:20       ` Edgar E. Iglesias
2011-02-07 22:55         ` Michael Walle
2011-02-07 23:01           ` Alexander Graf
2011-02-08 17:32   ` [Qemu-devel] " Richard Henderson
2011-02-08 20:00     ` Edgar E. Iglesias
2011-02-08 21:32     ` Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 03/17] lm32: translation code helper Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 04/17] lm32: machine state loading/saving Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 05/17] lm32: gdbstub support Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 06/17] lm32: interrupt controller model Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 07/17] lm32: juart model Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 08/17] lm32: pic and juart helper functions Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 09/17] lm32: timer model Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 10/17] lm32: uart model Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 11/17] lm32: system control model Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 12/17] lm32: support for creating device tree Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 13/17] lm32: EVR32 and uclinux BSP Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 14/17] lm32: todo and documentation Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 15/17] lm32: opcode testsuite Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 16/17] Add lm32 target to configure Michael Walle
2011-01-31  0:30 ` [Qemu-devel] [PATCH 17/17] MAINTAINERS: add LatticeMico32 maintainer Michael Walle
2011-02-07 16:28 ` [Qemu-devel] Re: [PATCH 00/17] LatticeMico32 target Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102072300.38534.michael@walle.cc \
    --to=michael@walle.cc \
    --cc=agraf@suse.de \
    --cc=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).