qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Sarah Harris <S.E.Harris@kent.ac.uk>, qemu-devel@nongnu.org
Cc: mrolnik@gmail.com, A.M.King@kent.ac.uk, E.J.C.Robbins@kent.ac.uk
Subject: Re: [Qemu-devel] [PATCH v1 1/8] target/avr: Add instruction decoder
Date: Sun, 5 May 2019 08:49:33 -0700	[thread overview]
Message-ID: <772cbab8-49a2-8969-ba3e-55f190c886ff@linaro.org> (raw)
In-Reply-To: <20190504083638.13380-2-S.E.Harris@kent.ac.uk>

On 5/4/19 1:36 AM, Sarah Harris wrote:
> This utility module builds a decision tree to decode instructions, starting from a human readable list of instruction bit patterns.
> Automatic tree generation will hopefully be more efficient and more maintainable than a hand-designed opcode parser.
> 
> Tree generation happens at startup because this seemed simpler to implement than adding a new build step.

We have such a thing in qemu already, as a separate build step.

See ./scripts/decodetree.py, and some of the uses in

  target/{arm,hppa,riscv}/*.decode

In addition to being able to select the instruction, it also
extracts arguments from the instruction, so there's less
repetition that you have for e.g.

 > +static inline uint32_t MOVW_Rr(uint32_t opcode)
> +{
> +    return extract32(opcode, 0, 4);
> +}
...
> +static inline uint32_t MULS_Rr(uint32_t opcode)
> +{
> +    return extract32(opcode, 0, 4);
> +}


r~

WARNING: multiple messages have this Message-ID (diff)
From: Richard Henderson <richard.henderson@linaro.org>
To: Sarah Harris <S.E.Harris@kent.ac.uk>, qemu-devel@nongnu.org
Cc: A.M.King@kent.ac.uk, mrolnik@gmail.com, E.J.C.Robbins@kent.ac.uk
Subject: Re: [Qemu-devel] [PATCH v1 1/8] target/avr: Add instruction decoder
Date: Sun, 5 May 2019 08:49:33 -0700	[thread overview]
Message-ID: <772cbab8-49a2-8969-ba3e-55f190c886ff@linaro.org> (raw)
Message-ID: <20190505154933.AVmd2Ef_Nc5ASTSx8Xwbto9wtBR694xB6jxGxKRAmkU@z> (raw)
In-Reply-To: <20190504083638.13380-2-S.E.Harris@kent.ac.uk>

On 5/4/19 1:36 AM, Sarah Harris wrote:
> This utility module builds a decision tree to decode instructions, starting from a human readable list of instruction bit patterns.
> Automatic tree generation will hopefully be more efficient and more maintainable than a hand-designed opcode parser.
> 
> Tree generation happens at startup because this seemed simpler to implement than adding a new build step.

We have such a thing in qemu already, as a separate build step.

See ./scripts/decodetree.py, and some of the uses in

  target/{arm,hppa,riscv}/*.decode

In addition to being able to select the instruction, it also
extracts arguments from the instruction, so there's less
repetition that you have for e.g.

 > +static inline uint32_t MOVW_Rr(uint32_t opcode)
> +{
> +    return extract32(opcode, 0, 4);
> +}
...
> +static inline uint32_t MULS_Rr(uint32_t opcode)
> +{
> +    return extract32(opcode, 0, 4);
> +}


r~


  parent reply	other threads:[~2019-05-05 15:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04  8:36 [Qemu-devel] [PATCH v1 0/8] DRAFT AVR Patches Sarah Harris
2019-05-04  8:36 ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 1/8] target/avr: Add instruction decoder Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-05 15:49   ` Richard Henderson [this message]
2019-05-05 15:49     ` Richard Henderson
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 2/8] target/avr: Add mechanism to check for active debugger connection Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 3/8] target/avr: Add outward facing interfaces and core CPU logic Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 4/8] target/avr: Add instruction helpers Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 5/8] target/avr: Add instruction translation Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 6/8] target/avr: Add limited support for USART and 16 bit timer peripherals Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 7/8] target/avr: Add example board configuration Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-04  8:36 ` [Qemu-devel] [PATCH v1 8/8] target/avr: Register AVR support with the rest of QEMU, the build system, and the MAINTAINERS file Sarah Harris
2019-05-04  8:36   ` Sarah Harris
2019-05-05 15:57   ` Richard Henderson
2019-05-05 15:57     ` Richard Henderson
2019-05-05 16:10     ` Michael Rolnik
2019-05-05 16:10       ` Michael Rolnik
2019-05-07 12:10       ` Sarah Harris
2019-05-10 11:17       ` Sarah Harris
2019-10-12  7:31         ` Philippe Mathieu-Daudé
2019-10-12 12:24           ` Aleksandar Markovic
2019-10-17 13:11           ` Sarah Harris
2019-05-06 15:11   ` Eric Blake
2019-05-06 20:07     ` Michael Rolnik

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=772cbab8-49a2-8969-ba3e-55f190c886ff@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=A.M.King@kent.ac.uk \
    --cc=E.J.C.Robbins@kent.ac.uk \
    --cc=S.E.Harris@kent.ac.uk \
    --cc=mrolnik@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).