qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Alistair Francis <Alistair.Francis@wdc.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>
Cc: "alistair23@gmail.com" <alistair23@gmail.com>
Subject: Re: [Qemu-devel] [RFC v3 19/24] riscv: tcg-target: Add the out op decoder
Date: Tue, 11 Dec 2018 16:44:56 -0600	[thread overview]
Message-ID: <042678a6-6837-e272-e4fa-eb0a8f265e6b@linaro.org> (raw)
In-Reply-To: <98465a90-99cc-bce6-8cde-5025a30b3785@linaro.org>

On 12/10/18 11:56 AM, Richard Henderson wrote:
> On 12/7/18 6:49 PM, Alistair Francis wrote:
>> +    case INDEX_op_neg_i64:
>> +        tcg_out_opc_imm(s, OPC_SUB, a0, TCG_REG_ZERO, a1);
> 
> tcg_out_opc_reg.
> 
>> +    case INDEX_op_mulsh_i32:
>> +    case INDEX_op_mulsh_i64:
>> +        tcg_out_opc_imm(s, OPC_MULH, a0, a1, a2);
>> +        break;
>> +
>> +    case INDEX_op_muluh_i32:
>> +    case INDEX_op_muluh_i64:
>> +        tcg_out_opc_imm(s, OPC_MULHU, a0, a1, a2);
>> +        break;
> 
> Likewise.

Incidentally, catching these sorts of errors is why tcg/s390 puts the format of
the insn into the enum.  E.g.

/* Emit an opcode with "type-checking" of the format.  */
#define tcg_out_insn(S, FMT, OP, ...) \
    glue(tcg_out_insn_,FMT)(S, glue(glue(FMT,_),OP), ## __VA_ARGS__)

    tcg_out_insn(s, RR, AR, a0, a2);
    tcg_out_insn(s, RRE, AGR, TCG_TMP0, index);

/* All of the following instructions are prefixed with their instruction
   format...  */
typedef enum S390Opcode {
    ...
    RR_AR       = 0x1a,
    RRE_AGR     = 0xb908,


I do something similar for tcg/aarch64, although that's more complicated due to
the wide variety of formats.

Whether you go back and retro-fit this scheme to your existing patch set is up
to you.  But I think it could be worthwhile.


r~

  reply	other threads:[~2018-12-11 22:45 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-08  0:46 [Qemu-devel] [RFC v3 00/24] Add RISC-V TCG backend support Alistair Francis
2018-12-08  0:46 ` [Qemu-devel] [RFC v3 01/24] elf.h: Add the RISCV ELF magic numbers Alistair Francis
2018-12-08  0:46 ` [Qemu-devel] [RFC v3 02/24] linux-user: Add host dependency for RISC-V 32-bit Alistair Francis
2018-12-08  0:46 ` [Qemu-devel] [RFC v3 03/24] linux-user: Add host dependency for RISC-V 64-bit Alistair Francis
2018-12-08  0:46 ` [Qemu-devel] [RFC v3 04/24] linux-user: riscv: Fix compile failure on riscv32 hosts Alistair Francis
2018-12-10 17:04   ` Richard Henderson
2018-12-12  0:20     ` Alistair Francis
2018-12-08  0:46 ` [Qemu-devel] [RFC v3 05/24] exec: Add RISC-V GCC poison macro Alistair Francis
2018-12-08  0:47 ` [Qemu-devel] [RFC v3 06/24] riscv: Add the tcg-target header file Alistair Francis
2018-12-08  0:47 ` [Qemu-devel] [RFC v3 07/24] riscv: Add the tcg target registers Alistair Francis
2018-12-08  0:47 ` [Qemu-devel] [RFC v3 08/24] riscv: tcg-target: Add support for the constraints Alistair Francis
2018-12-12  2:27   ` Richard Henderson
2018-12-08  0:47 ` [Qemu-devel] [RFC v3 09/24] riscv: tcg-target: Add the immediate encoders Alistair Francis
2018-12-08  0:47 ` [Qemu-devel] [RFC v3 10/24] riscv: tcg-target: Add the instruction emitters Alistair Francis
2018-12-08  0:47 ` [Qemu-devel] [RFC v3 11/24] riscv: tcg-target: Add the relocation functions Alistair Francis
2018-12-08  0:48 ` [Qemu-devel] [RFC v3 12/24] riscv: tcg-target: Add the mov and movi instruction Alistair Francis
2018-12-08  0:48 ` [Qemu-devel] [RFC v3 13/24] riscv: tcg-target: Add the extract instructions Alistair Francis
2018-12-08  0:48 ` [Qemu-devel] [RFC v3 14/24] riscv: tcg-target: Add the out load and store instructions Alistair Francis
2018-12-08  0:48 ` [Qemu-devel] [RFC v3 15/24] riscv: tcg-target: Add the add2 and sub2 instructions Alistair Francis
2018-12-10 17:28   ` Richard Henderson
2018-12-12  2:51   ` Richard Henderson
2018-12-08  0:48 ` [Qemu-devel] [RFC v3 16/24] riscv: tcg-target: Add branch and jump instructions Alistair Francis
2018-12-08  0:48 ` [Qemu-devel] [RFC v3 17/24] riscv: tcg-target: Add slowpath load and store instructions Alistair Francis
2018-12-10 17:38   ` Richard Henderson
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 18/24] riscv: tcg-target: Add direct " Alistair Francis
2018-12-10 17:43   ` Richard Henderson
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 19/24] riscv: tcg-target: Add the out op decoder Alistair Francis
2018-12-10 17:56   ` Richard Henderson
2018-12-11 22:44     ` Richard Henderson [this message]
2018-12-12  0:04       ` Alistair Francis
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 20/24] riscv: tcg-target: Add the prologue generation and register the JIT Alistair Francis
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 21/24] riscv: tcg-target: Add the target init code Alistair Francis
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 22/24] tcg: Add RISC-V cpu signal handler Alistair Francis
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 23/24] dias: Add RISC-V support Alistair Francis
2018-12-08  0:49 ` [Qemu-devel] [RFC v3 24/24] configure: Add support for building RISC-V host Alistair Francis
2018-12-08  2:13 ` [Qemu-devel] [RFC v3 00/24] Add RISC-V TCG backend support no-reply

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=042678a6-6837-e272-e4fa-eb0a8f265e6b@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=Alistair.Francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@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).