[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 05/17] target/riscv: array for the 64 upper bits of 128-bi
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 05/17] target/riscv: array for the 64 upper bits of 128-bit registers |
Date: |
Mon, 25 Oct 2021 17:55:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 10/25/21 14:28, Frédéric Pétrot wrote:
> The upper 64-bit of the 128-bit registers have now a place inside
> the cpu state structure, and are created as globals for future use.
>
> Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
> Co-authored-by: Fabien Portas <fabien.portas@grenoble-inp.org>
> ---
> target/riscv/cpu.h | 2 ++
> target/riscv/cpu.c | 9 +++++++++
> target/riscv/machine.c | 20 ++++++++++++++++++++
> target/riscv/translate.c | 5 ++++-
> 4 files changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> index a33dc30be8..f6d7a1793d 100644
> --- a/target/riscv/cpu.h
> +++ b/target/riscv/cpu.h
> @@ -109,6 +109,7 @@ FIELD(VTYPE, VILL, sizeof(target_ulong) * 8 - 1, 1)
>
> struct CPURISCVState {
> target_ulong gpr[32];
#if TARGET_LONG_BITS > 32 ?
> + target_ulong gprh[32]; /* 64 top bits of the 128-bit registers */
Shouldn't this be uint64_t?
#endif
> /* global register indices */
> -static TCGv cpu_gpr[32], cpu_pc, cpu_vl;
> +static TCGv cpu_gpr[32], cpu_gprh[32], cpu_pc, cpu_vl;
and TCGv_i64, with ifdef'ry?
> static TCGv_i64 cpu_fpr[32]; /* assume F and D extensions */
> static TCGv load_res;
> static TCGv load_val;
> @@ -749,10 +749,13 @@ void riscv_translate_init(void)
> * unless you specifically block reads/writes to reg 0.
> */
> cpu_gpr[0] = NULL;
> + cpu_gprh[0] = NULL;
>
> for (i = 1; i < 32; i++) {
> cpu_gpr[i] = tcg_global_mem_new(cpu_env,
> offsetof(CPURISCVState, gpr[i]), riscv_int_regnames[i]);
> + cpu_gprh[i] = tcg_global_mem_new(cpu_env,
> + offsetof(CPURISCVState, gprh[i]), riscv_int_regnamesh[i]);
> }
>
> for (i = 0; i < 32; i++) {
>
- [PATCH v4 00/17] Adding partial support for 128-bit riscv target, Frédéric Pétrot, 2021/10/25
- [PATCH v4 05/17] target/riscv: array for the 64 upper bits of 128-bit registers, Frédéric Pétrot, 2021/10/25
- [PATCH v4 01/17] exec/memop: Rename MO_Q definition as MO_UQ and add MO_UO, Frédéric Pétrot, 2021/10/25
- [PATCH v4 03/17] target/riscv: additional macros to check instruction support, Frédéric Pétrot, 2021/10/25
- [PATCH v4 02/17] qemu/int128: addition of a few 128-bit operations, Frédéric Pétrot, 2021/10/25
- [PATCH v4 04/17] target/riscv: separation of bitwise logic and aritmetic helpers, Frédéric Pétrot, 2021/10/25