From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4FYX-0002T5-Mp for qemu-devel@nongnu.org; Mon, 07 Jul 2014 16:30:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4FYO-0007L8-Hu for qemu-devel@nongnu.org; Mon, 07 Jul 2014 16:30:33 -0400 Received: from mail-qc0-x22b.google.com ([2607:f8b0:400d:c01::22b]:40325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4FYO-0007Ky-Do for qemu-devel@nongnu.org; Mon, 07 Jul 2014 16:30:24 -0400 Received: by mail-qc0-f171.google.com with SMTP id w7so4472574qcr.30 for ; Mon, 07 Jul 2014 13:30:24 -0700 (PDT) Sender: Richard Henderson Message-ID: <53BB035C.3000501@twiddle.net> Date: Mon, 07 Jul 2014 13:30:20 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1404756822-3253-1-git-send-email-kbastian@mail.uni-paderborn.de> <1404756822-3253-10-git-send-email-kbastian@mail.uni-paderborn.de> In-Reply-To: <1404756822-3253-10-git-send-email-kbastian@mail.uni-paderborn.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/15] target-tricore: Add instructions of SRRS and SLRO opcode format. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bastian Koppelmann , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org 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~