qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 09/15] target-tricore: Add instructions of SRRS


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 09/15] target-tricore: Add instructions of SRRS and SLRO opcode format.
Date: Mon, 07 Jul 2014 13:30:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/07/2014 11:13 AM, Bastian Koppelmann wrote:
> +/* Functions for load/save to/from memory */
> +#define OP_MEM_INDIRECT(insn)                                             \
> +static inline void gen_indirect_##insn(DisasContext *ctx, TCGv r1, TCGv r2, \
> +                                       int16_t con)                       \
> +{                                                                         \
> +    TCGv temp = tcg_temp_new();                                           \
> +    TCGv tempPC = tcg_const_i32(ctx->pc);                                 \
> +    tcg_gen_addi_tl(temp, r2, con);                                         \
> +    tcg_gen_qemu_##insn(r1, temp, ctx->mem_idx);                            \
> +    tcg_temp_free(tempPC);                                                \
> +    tcg_temp_free(temp);                                                  \
> +}
> +OP_MEM_INDIRECT(ld8s)
> +OP_MEM_INDIRECT(ld8u)
> +OP_MEM_INDIRECT(ld16s)
> +OP_MEM_INDIRECT(ld16u)
> +OP_MEM_INDIRECT(ld32s)
> +OP_MEM_INDIRECT(ld32u)

Please just rearrange all of your memory operations to use the new TCGMemOp
enumeration and the common tcg_gen_qemu_{ld,st}_tl functions.

I nearly suggested that for patch 8, but it's quite obvious here.

tempPC is unused here.

Why call this "indirect"?  A better term would be "offset".


r~



reply via email to

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