[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 25/34] Hexagon (target/hexagon) macros to interface wi
From: |
Richard Henderson |
Subject: |
Re: [RFC PATCH v3 25/34] Hexagon (target/hexagon) macros to interface with the generator |
Date: |
Fri, 28 Aug 2020 17:49:17 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 8/18/20 8:50 AM, Taylor Simpson wrote:
> +#define DECL_REG(NAME, NUM, X, OFF) \
> + TCGv NAME = tcg_temp_local_new(); \
> + int NUM = REGNO(X) + OFF
> +
> +#define DECL_REG_WRITABLE(NAME, NUM, X, OFF) \
> + TCGv NAME = tcg_temp_local_new(); \
> + int NUM = REGNO(X) + OFF; \
> + do { \
> + int is_predicated = GET_ATTRIB(insn->opcode, A_CONDEXEC); \
> + if (is_predicated && !is_preloaded(ctx, NUM)) { \
> + tcg_gen_mov_tl(hex_new_value[NUM], hex_gpr[NUM]); \
> + } \
> + } while (0)
> +/*
> + * For read-only temps, avoid allocating and freeing
> + */
> +#define DECL_REG_READONLY(NAME, NUM, X, OFF) \
> + TCGv NAME; \
> + int NUM = REGNO(X) + OFF
> +
> +#define DECL_RREG_d(NAME, NUM, X, OFF) \
> + DECL_REG_WRITABLE(NAME, NUM, X, OFF)
> +#define DECL_RREG_e(NAME, NUM, X, OFF) \
> + DECL_REG(NAME, NUM, X, OFF)
Is there a good reason for all these macros?
Why not just bake this knowledge into gen_tcg_funcs.py?
Seems like it would be just a couple of functions...
At present, both this and the intermediary files are unreadable. One has to
pass genptr.c through -E and indent to see what's going on.
r~
- Re: [RFC PATCH v3 26/34] Hexagon (target/hexagon) macros referenced in instruction semantics, (continued)
[RFC PATCH v3 24/34] Hexagon (target/hexagon) opcode data structures, Taylor Simpson, 2020/08/18
[RFC PATCH v3 18/34] Hexagon (target/hexagon/imported) arch import - instruction semantics, Taylor Simpson, 2020/08/18
[RFC PATCH v3 19/34] Hexagon (target/hexagon/imported) arch import - instruction encoding, Taylor Simpson, 2020/08/18
[RFC PATCH v3 25/34] Hexagon (target/hexagon) macros to interface with the generator, Taylor Simpson, 2020/08/18
- Re: [RFC PATCH v3 25/34] Hexagon (target/hexagon) macros to interface with the generator,
Richard Henderson <=
[RFC PATCH v3 20/34] Hexagon (target/hexagon) generator phase 1 - C preprocessor for semantics, Taylor Simpson, 2020/08/18
[RFC PATCH v3 28/34] Hexagon (target/hexagon) TCG generation helpers, Taylor Simpson, 2020/08/18
[RFC PATCH v3 29/34] Hexagon (target/hexagon) TCG generation, Taylor Simpson, 2020/08/18