[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/6] target/mips: Convert Loongson LEXT opcodes to decodetree
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 0/6] target/mips: Convert Loongson LEXT opcodes to decodetree |
Date: |
Wed, 13 Jan 2021 09:06:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 1/13/21 3:15 AM, Jiaxun Yang wrote:
> 在 2021/1/13 上午5:54, Philippe Mathieu-Daudé 写道:
>> Loongson is next step in the "MIPS decodetree conversion" epic.
>> Start with the simplest extension.
>>
>> The diffstat addition comes from the TCG functions expanded.
>> The code is easier to review now.
>> IMO this is also a good template to show how easy a decodetree
>> conversion can be (and how nice the .decode file is to review) :P
>>
>> Please review,
>>
>> Phil.
>>
>> Based-on: <20210112184156.2014305-1-f4bug@amsat.org>
>> "decodetree: Allow 'dot' in opcode names"
>>
>> Philippe Mathieu-Daudé (6):
>> target/mips: Re-introduce OPC_ADDUH_QB_DSP and OPC_MUL_PH_DSP
>> target/mips: Convert Loongson DDIV.G opcodes to decodetree
>> target/mips: Convert Loongson DIV.G opcodes to decodetree
>> target/mips: Convert Loongson [D]DIVU.G opcodes to decodetree
>> target/mips: Convert Loongson [D]MOD[U].G opcodes to decodetree
>> target/mips: Convert Loongson [D]MULT[U].G opcodes to decodetree
>>
>> target/mips/translate.h | 1 +
>> target/mips/godson2.decode | 29 +++
>> target/mips/loong-ext.decode | 30 +++
>
> Hi Philippe,
>
> Thanks for the template!
>
> Just a small question, where should we perform ISA availability check?
> Before calling generated decoder or after decoded?
The check is done before in decode_loongson:
bool decode_loongson(DisasContext *ctx, uint32_t insn)
{
if ((ctx->insn_flags & INSN_LOONGSON2E)
// if ISA available ...
&& decode_godson2(ctx, ctx->opcode)) {
// and opcode supported
// return success
return true;
}
// else keep going ...
if ((ctx->insn_flags & ASE_LEXT)
&& decode_loong_ext(ctx, ctx->opcode)) {
return true;
}
// finally return false, if nothing else decoded
// gen_reserved_instruction will be called in the
// main decode loop.
return false;
}
>
> Loong-EXT is a super set of Loongson2F's Godson2 and MMI instructions,
> how could we tell it?
MMI instructions are currently handled by the ASE_LMMI flag,
a different decoder (which will also be handled by this function,
similarly to ASE_LEXT).
Regards,
Phil.
- [PATCH 4/6] target/mips: Convert Loongson [D]DIVU.G opcodes to decodetree, (continued)
- [PATCH 4/6] target/mips: Convert Loongson [D]DIVU.G opcodes to decodetree, Philippe Mathieu-Daudé, 2021/01/12
- [PATCH 3/6] target/mips: Convert Loongson DIV.G opcodes to decodetree, Philippe Mathieu-Daudé, 2021/01/12
- [PATCH 5/6] target/mips: Convert Loongson [D]MOD[U].G opcodes to decodetree, Philippe Mathieu-Daudé, 2021/01/12
- [PATCH 6/6] target/mips: Convert Loongson [D]MULT[U].G opcodes to decodetree, Philippe Mathieu-Daudé, 2021/01/12
- Re: [PATCH 0/6] target/mips: Convert Loongson LEXT opcodes to decodetree, Jiaxun Yang, 2021/01/12
- Re: [PATCH 0/6] target/mips: Convert Loongson LEXT opcodes to decodetree,
Philippe Mathieu-Daudé <=
- Re: [PATCH 0/6] target/mips: Convert Loongson LEXT opcodes to decodetree, Richard Henderson, 2021/01/21