qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 03/15] arc: Opcode definitions table


From: Richard Henderson
Subject: Re: [PATCH 03/15] arc: Opcode definitions table
Date: Tue, 1 Dec 2020 14:22:53 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 11/11/20 10:17 AM, cupertinomiranda@gmail.com wrote:
> From: Claudiu Zissulescu <claziss@synopsys.com>
> 
> Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
> ---
>  target/arc/opcodes.def | 19976 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 19976 insertions(+)
>  create mode 100644 target/arc/opcodes.def

OMG.  20k lines.

I assume this is gnu binutils opcodes/arc-tbl.h?

You are the contributor there, so a re-license is fine.  It would be good to
document the upstream location and revision, against some future re-sync.

That said, this format is less than ideal:

> +/* abs<.f> b,c 00100bbb00101111FBBBCCCCCC001001.  */
> +{ "abs", 0x202F0009, 0xF8FF003F, ARC_OPCODE_ARC600 | ARC_OPCODE_ARC700 | 
> ARC_OPCODE_ARCv2EM | ARC_OPCODE_ARCv2HS, ARITH, NONE, { OPERAND_RB, 
> OPERAND_RC }, { C_F }},

You've got the same information in two places
(00100bbb00101111FBBBCCCCCC001001) vs (0x202F0009, 0xF8FF003F, OPERAND_*).
Moreover, "abs" as a string is not especially useful, and means that you have
to deal with strings in the translator instead of C symbols or enumerators.

It would be relatively easy to generate a decodetree file from this input,
which would simplify the translator.

At a bare minimum strip the quotes and wrap in a macro so that you can (1)
define an enumerator and (2) put the entries into an array indexed by the
enumerator.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]