qemu-devel
[Top][All Lists]
Advanced

[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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]