From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E1B8CD128A for ; Mon, 8 Apr 2024 08:54:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtklK-0000dK-A2; Mon, 08 Apr 2024 04:53:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtklG-0000Zi-TP for qemu-devel@nongnu.org; Mon, 08 Apr 2024 04:53:54 -0400 Received: from ik1-413-38519.vs.sakura.ne.jp ([153.127.30.23] helo=sakura.ysato.name) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtklF-0005Td-4d for qemu-devel@nongnu.org; Mon, 08 Apr 2024 04:53:54 -0400 Received: from SIOS1075.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id DBDA21C102D; Mon, 8 Apr 2024 17:53:49 +0900 (JST) Date: Mon, 08 Apr 2024 17:53:49 +0900 Message-ID: <877ch8ck0y.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Richard Henderson Cc: qemu-devel@nongnu.org Subject: Re: [PATCH 30/32] target/rx: Use translator_ld* In-Reply-To: <20240405102459.462551-31-richard.henderson@linaro.org> References: <20240405102459.462551-1-richard.henderson@linaro.org> <20240405102459.462551-31-richard.henderson@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Received-SPF: softfail client-ip=153.127.30.23; envelope-from=ysato@users.sourceforge.jp; helo=sakura.ysato.name X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Fri, 05 Apr 2024 19:24:57 +0900, Richard Henderson wrote: > > Cc: Yoshinori Sato > Signed-off-by: Richard Henderson > --- > target/rx/translate.c | 27 ++++++++++++++------------- > 1 file changed, 14 insertions(+), 13 deletions(-) > > diff --git a/target/rx/translate.c b/target/rx/translate.c > index 92fb2b43ad..9b81cf20b3 100644 > --- a/target/rx/translate.c > +++ b/target/rx/translate.c > @@ -22,7 +22,6 @@ > #include "cpu.h" > #include "exec/exec-all.h" > #include "tcg/tcg-op.h" > -#include "exec/cpu_ldst.h" > #include "exec/helper-proto.h" > #include "exec/helper-gen.h" > #include "exec/translator.h" > @@ -75,10 +74,10 @@ static TCGv_i64 cpu_acc; > > /* decoder helper */ > static uint32_t decode_load_bytes(DisasContext *ctx, uint32_t insn, > - int i, int n) > + int i, int n) > { > while (++i <= n) { > - uint8_t b = cpu_ldub_code(ctx->env, ctx->base.pc_next++); > + uint8_t b = translator_ldub(ctx->env, &ctx->base, ctx->base.pc_next++); > insn |= b << (32 - i * 8); > } > return insn; > @@ -90,22 +89,24 @@ static uint32_t li(DisasContext *ctx, int sz) > CPURXState *env = ctx->env; > addr = ctx->base.pc_next; > > - tcg_debug_assert(sz < 4); > switch (sz) { > case 1: > ctx->base.pc_next += 1; > - return cpu_ldsb_code(env, addr); > + return (int8_t)translator_ldub(env, &ctx->base, addr); > case 2: > ctx->base.pc_next += 2; > - return cpu_ldsw_code(env, addr); > + return (int16_t)translator_lduw(env, &ctx->base, addr); > case 3: > ctx->base.pc_next += 3; > - tmp = cpu_ldsb_code(env, addr + 2) << 16; > - tmp |= cpu_lduw_code(env, addr) & 0xffff; > + tmp = (int8_t)translator_ldub(env, &ctx->base, addr + 2); > + tmp <<= 16; > + tmp |= translator_lduw(env, &ctx->base, addr); > return tmp; > case 0: > ctx->base.pc_next += 4; > - return cpu_ldl_code(env, addr); > + return translator_ldl(env, &ctx->base, addr); > + default: > + g_assert_not_reached(); > } > return 0; > } > @@ -190,22 +191,22 @@ static inline TCGv rx_index_addr(DisasContext *ctx, TCGv mem, > { > uint32_t dsp; > > - tcg_debug_assert(ld < 3); > switch (ld) { > case 0: > return cpu_regs[reg]; > case 1: > - dsp = cpu_ldub_code(ctx->env, ctx->base.pc_next) << size; > + dsp = translator_ldub(ctx->env, &ctx->base, ctx->base.pc_next) << size; > tcg_gen_addi_i32(mem, cpu_regs[reg], dsp); > ctx->base.pc_next += 1; > return mem; > case 2: > - dsp = cpu_lduw_code(ctx->env, ctx->base.pc_next) << size; > + dsp = translator_lduw(ctx->env, &ctx->base, ctx->base.pc_next) << size; > tcg_gen_addi_i32(mem, cpu_regs[reg], dsp); > ctx->base.pc_next += 2; > return mem; > + default: > + g_assert_not_reached(); > } > - return NULL; > } > > static inline MemOp mi_to_mop(unsigned mi) > -- > 2.34.1 > Reviewed-by: Yoshinori Sato -- Yosinori Sato