All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: gaosong <gaosong@loongson.cn>
Cc: Xiaojuan Yang <yangxiaojuan@loongson.cn>,
	qemu-devel@nongnu.org, laurent@vivier.eu
Subject: Re: [PATCH v10 04/26] target/loongarch: Add fixed point arithmetic instruction translation
Date: Wed, 17 Nov 2021 09:28:53 +0100	[thread overview]
Message-ID: <e26b8243-2797-cde9-3833-a7c4cd3b6a65@linaro.org> (raw)
In-Reply-To: <6e225d21-c2e4-69d0-c4f9-d2018096ec70@loongson.cn>

On 11/17/21 8:57 AM, gaosong wrote:
> I see that  insns.decode format is not very consistent with other architectures, such 
> ARM/RISCV

No.  I don't like how riscv has done it, though they have quite a few split fields, so 
perhaps they thought it looked weird.


> #
> # Argument sets
> #
> &r_i          rd imm
> &rrr          rd rj rk
> &rr_i         rd rj imm
> &rrr_sa     rd rj rk sa
> 
> #
> # Formats
> #
> @fmt_rrr             .... ........ ..... rk:5 rj:5 rd:5 &rrr
> @fmt_r_i20                        .... ... imm:s20 rd:5 &r_i
> @fmt_rr_i12               .... ...... imm:s12 rj:5 rd:5 &rr_i
> @fmt_rr_ui12               .... ...... imm:12 rj:5 rd:5 &rr_i
> @fmt_rr_i16                   .... .. imm:s16 rj:5 rd:5 &rr_i
> @fmt_rrr_sa2p1      .... ........ ... .. rk:5 rj:5 rd:5 &rrr_sa  sa=%sa2p1
> 
> #
> # Fixed point arithmetic operation instruction
> #
> add_w            0000 00000001 00000 ..... ..... .....    @fmt_rrr
> add_d            0000 00000001 00001 ..... ..... .....    @fmt_rrr
> sub_w            0000 00000001 00010 ..... ..... .....    @fmt_rrr
> sub_d            0000 00000001 00011 ..... ..... .....    @fmt_rrr
> slt              0000 00000001 00100 ..... ..... ..... @fmt_rrr
> sltu             0000 00000001 00101 ..... ..... ..... @fmt_rrr
> slti             0000 001000 ............ ..... .....               @fmt_rr_i12
> 
> 
> and trans_xxx.c.inc
> 
> static bool gen_rrr(DisasContext *ctx, arg_rrr *a, ...) {}
> static bool gen_rr_i12(DisasContext *ctx, arg_rr_i *a, ) {}

gen_rr_i ?

> static bool gen_rrr_sa2p1(DisasContext *ctx, arg_rrr_sa *a, ...) {}

gen_rrr_sa ?

> Richard, is that OK?

Other than those two nits, this looks very clean.  Thanks,


r~


  reply	other threads:[~2021-11-17  8:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12  6:53 [PATCH v10 00/26] Add LoongArch linux-user emulation support Song Gao
2021-11-12  6:53 ` [PATCH v10 01/26] target/loongarch: Add README Song Gao
2021-11-12  6:53 ` [PATCH v10 02/26] target/loongarch: Add core definition Song Gao
2021-11-12  6:53 ` [PATCH v10 03/26] target/loongarch: Add main translation routines Song Gao
2021-11-12  6:53 ` [PATCH v10 04/26] target/loongarch: Add fixed point arithmetic instruction translation Song Gao
2021-11-12 14:05   ` Richard Henderson
2021-11-13  3:18     ` WANG Xuerui
2021-11-15  3:59     ` gaosong
2021-11-15  8:42       ` Richard Henderson
2021-11-17  7:57         ` gaosong
2021-11-17  8:28           ` Richard Henderson [this message]
2021-11-17  9:29             ` gaosong
2021-11-17  9:55               ` Richard Henderson
2021-11-18  1:24                 ` gaosong
2021-11-12  6:53 ` [PATCH v10 05/26] target/loongarch: Add fixed point shift " Song Gao
2021-11-12  6:53 ` [PATCH v10 06/26] target/loongarch: Add fixed point bit " Song Gao
2021-11-12  6:53 ` [PATCH v10 07/26] target/loongarch: Add fixed point load/store " Song Gao
2021-11-12  6:53 ` [PATCH v10 08/26] target/loongarch: Add fixed point atomic " Song Gao
2021-11-12  6:53 ` [PATCH v10 09/26] target/loongarch: Add fixed point extra " Song Gao
2021-11-12  6:53 ` [PATCH v10 10/26] target/loongarch: Add floating point arithmetic " Song Gao
2021-11-12  6:53 ` [PATCH v10 11/26] target/loongarch: Add floating point comparison " Song Gao
2021-11-12  6:53 ` [PATCH v10 12/26] target/loongarch: Add floating point conversion " Song Gao
2021-11-12  6:53 ` [PATCH v10 13/26] target/loongarch: Add floating point move " Song Gao
2021-11-12  6:53 ` [PATCH v10 14/26] target/loongarch: Add floating point load/store " Song Gao
2021-11-12  6:53 ` [PATCH v10 15/26] target/loongarch: Add branch " Song Gao
2021-11-12  6:53 ` [PATCH v10 16/26] target/loongarch: Add disassembler Song Gao
2021-11-12  7:39   ` Richard Henderson
2021-11-12  9:59     ` gaosong
2021-11-12  6:54 ` [PATCH v10 17/26] linux-user: Add LoongArch generic header files Song Gao
2021-11-16  8:33   ` Philippe Mathieu-Daudé
2021-11-16 11:50     ` gaosong
2021-11-12  6:54 ` [PATCH v10 18/26] linux-user: Add LoongArch specific structures Song Gao
2021-11-12  6:54 ` [PATCH v10 19/26] linux-user: Add LoongArch signal support Song Gao
2021-11-12  6:54 ` [PATCH v10 20/26] linux-user: Add LoongArch elf support Song Gao
2021-11-12  6:54 ` [PATCH v10 21/26] linux-user: Add LoongArch syscall support Song Gao
2021-11-12  6:54 ` [PATCH v10 22/26] linux-user: Add LoongArch cpu_loop support Song Gao
2021-11-12  6:54 ` [PATCH v10 23/26] default-configs: Add loongarch linux-user support Song Gao
2021-11-12  6:54 ` [PATCH v10 24/26] target/loongarch: Add target build suport Song Gao
2021-11-12  6:54 ` [PATCH v10 25/26] target/loongarch: 'make check-tcg' support Song Gao
2021-11-12  6:54 ` [PATCH v10 26/26] scripts: add loongarch64 binfmt config Song Gao

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=e26b8243-2797-cde9-3833-a7c4cd3b6a65@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=gaosong@loongson.cn \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=yangxiaojuan@loongson.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.