[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 13/35] Hexagon (target/hexagon) instruction/packet decode
From: |
Richard Henderson |
Subject: |
Re: [PATCH v8 13/35] Hexagon (target/hexagon) instruction/packet decode |
Date: |
Sun, 14 Feb 2021 10:31:40 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 2/7/21 9:46 PM, Taylor Simpson wrote:
> +#define DECODE_MAPPED_REG(REGNO, NAME) \
> + insn->regno[REGNO] = DECODE_REGISTER_##NAME[insn->regno[REGNO]];
The macro argument is not a regno, but an operand number.
> +static inline int decode_opcode_can_jump(int opcode)
> +{
> + if ((GET_ATTRIB(opcode, A_JUMP)) ||
> + (GET_ATTRIB(opcode, A_CALL)) ||
> + (opcode == J2_trap0) ||
> + (opcode == J2_pause)) {
> + /* Exception to A_JUMP attribute */
> + if (opcode == J4_hintjumpr) {
> + return 0;
> + }
> + return 1;
> + }
> +
> + return 0;
> +}
> +
> +static inline int decode_opcode_ends_loop(int opcode)
> +{
> + return GET_ATTRIB(opcode, A_HWLOOP0_END) ||
> + GET_ATTRIB(opcode, A_HWLOOP1_END);
> +}
You can drop the inline markers.
You should use bool for booleans.
> +/*
> + * Shuffle for execution
> + * Move stores to end (in same order as encoding)
> + * Move compares to beginning (for use by .new insns)
> + */
> +static void decode_shuffle_for_execution(Packet *packet)
> +{
> + int changed = 0;
> + int i;
> + int flag; /* flag means we've seen a non-memory instruction */
Both changed and flag should be bool. Please have another look through and use
bool as reasonable.
Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- Re: [PATCH v8 12/35] Hexagon (target/hexagon) instruction attributes, (continued)
- [PATCH v8 01/35] Hexagon Update MAINTAINERS file, Taylor Simpson, 2021/02/08
- [PATCH v8 14/35] Hexagon (target/hexagon) instruction printing, Taylor Simpson, 2021/02/08
- [PATCH v8 04/35] Hexagon (target/hexagon) scalar core definition, Taylor Simpson, 2021/02/08
- [PATCH v8 11/35] Hexagon (target/hexagon) register fields, Taylor Simpson, 2021/02/08
- [PATCH v8 03/35] Hexagon (include/elf.h) ELF machine definition, Taylor Simpson, 2021/02/08
- [PATCH v8 05/35] Hexagon (disas) disassembler, Taylor Simpson, 2021/02/08
- [PATCH v8 13/35] Hexagon (target/hexagon) instruction/packet decode, Taylor Simpson, 2021/02/08
- Re: [PATCH v8 13/35] Hexagon (target/hexagon) instruction/packet decode,
Richard Henderson <=
- [PATCH v8 19/35] Hexagon (target/hexagon) generator phase 1 - C preprocessor for semantics, Taylor Simpson, 2021/02/08
- [PATCH v8 06/35] Hexagon (target/hexagon) register names, Taylor Simpson, 2021/02/08
- [PATCH v8 09/35] Hexagon (target/hexagon) architecture types, Taylor Simpson, 2021/02/08
- [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation, Taylor Simpson, 2021/02/08
- [PATCH v8 10/35] Hexagon (target/hexagon) instruction and packet types, Taylor Simpson, 2021/02/08