[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 02/21] target/loongarch: Add core definition
From: |
Song Gao |
Subject: |
Re: [PATCH v7 02/21] target/loongarch: Add core definition |
Date: |
Wed, 20 Oct 2021 16:54:01 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux mips64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Hi, Xuerui, Philippe.
On 10/19/2021 01:38 AM, Philippe Mathieu-Daudé wrote:
> On 10/18/21 18:06, WANG Xuerui wrote:
>> Hi Song,
>>
>> On 10/18/21 20:47, Song Gao wrote:
>>> This patch add target state header, target definitions
>>> and initialization routines.
>> "adds"; fix in other patches too.
>>>
>>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>>> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>> target/loongarch/cpu-param.h | 19 +++
>>> target/loongarch/cpu.c | 285
>>> +++++++++++++++++++++++++++++++++++++++++++
>>> target/loongarch/cpu.h | 151 +++++++++++++++++++++++
>>> target/loongarch/internals.h | 23 ++++
>>> 4 files changed, 478 insertions(+)
>>> create mode 100644 target/loongarch/cpu-param.h
>>> create mode 100644 target/loongarch/cpu.c
>>> create mode 100644 target/loongarch/cpu.h
>>> create mode 100644 target/loongarch/internals.h
>
>
>>> +static void set_loongarch_cpucfg(CPULoongArchState *env)
>>> +{
>>> + int i;
>>> +
>>> + for (i = 0; i < 49; i++) {
>>> + env->cpucfg[i] = 0x0;
>>> + }
>>> + env->cpucfg[0] = 0x14c010;
>>> + env->cpucfg[1] = 0x3f2f2fe;
>>> + env->cpucfg[2] = 0x60c3cf;
>>> + env->cpucfg[3] = 0xcff;
>>> + env->cpucfg[4] = 0x5f5e100;
>>> + env->cpucfg[5] = 0x10001;
>>> + env->cpucfg[16] = 0x2c3d;
>>> + env->cpucfg[17] = 0x6080003;
>>> + env->cpucfg[18] = 0x6080003;
>>> + env->cpucfg[19] = 0x60800f;
>>> + env->cpucfg[20] = 0x60f000f;
>> I know these values are taken from a real 3A5000 chip, since I have such
>> a machine and I've done the experiment, but others likely wouldn't
>> notice so quickly. Maybe put some comment on top of this function to
>> illustrate this?
>
> Simpler: ...
>
On linux-user emulation. We don't care about the value of cpucfg[i].
I think we only need to set cpucfg[i] to 0. and set value on system emulations,
is that better?
>>> +}
>>> +
>>> +/* LoongArch CPU definitions */
>> Doc-string for such a function should be verb phrase; but in this case
>> would it be better to just drop the comment? The code is pretty concise
>> and self-documenting after all.
>>> +static void loongarch_3a5000_initfn(Object *obj)
>>> +{
>>> + LoongArchCPU *cpu = LOONGARCH_CPU(obj);
>>> + CPULoongArchState *env = &cpu->env;
>>> +
>>> + set_loongarch_cpucfg(env);
>
> ... directly inline here.
> OK.
Thanks
Song Gao
>>> +}
- [PATCH v7 03/21] target/loongarch: Add main translation routines, (continued)
- [PATCH v7 03/21] target/loongarch: Add main translation routines, Song Gao, 2021/10/18
- [PATCH v7 07/21] target/loongarch: Add fixed point load/store instruction translation, Song Gao, 2021/10/18
- [PATCH v7 05/21] target/loongarch: Add fixed point shift instruction translation, Song Gao, 2021/10/18
- [PATCH v7 06/21] target/loongarch: Add fixed point bit instruction translation, Song Gao, 2021/10/18
- [PATCH v7 08/21] target/loongarch: Add fixed point atomic instruction translation, Song Gao, 2021/10/18
- [PATCH v7 10/21] target/loongarch: Add floating point arithmetic instruction translation, Song Gao, 2021/10/18
- [PATCH v7 02/21] target/loongarch: Add core definition, Song Gao, 2021/10/18
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, WANG Xuerui, 2021/10/18
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, Philippe Mathieu-Daudé, 2021/10/18
- Re: [PATCH v7 02/21] target/loongarch: Add core definition,
Song Gao <=
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, WANG Xuerui, 2021/10/20
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, Richard Henderson, 2021/10/20
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, Song Gao, 2021/10/20
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, WANG Xuerui, 2021/10/21
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, Bob Proulx, 2021/10/21
- Re: [PATCH v7 02/21] target/loongarch: Add core definition, yangxiaojuan, 2021/10/21
[PATCH v7 09/21] target/loongarch: Add fixed point extra instruction translation, Song Gao, 2021/10/18
[PATCH v7 11/21] target/loongarch: Add floating point comparison instruction translation, Song Gao, 2021/10/18
[PATCH v7 12/21] target/loongarch: Add floating point conversion instruction translation, Song Gao, 2021/10/18
[PATCH v7 13/21] target/loongarch: Add floating point move instruction translation, Song Gao, 2021/10/18