From nobody Mon Nov 25 11:55:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1715759708; cv=none; d=zohomail.com; s=zohoarc; b=cczCXSAu8m+HGamriqyNCIVHfxLz6WVdCRCmGee+yH3FLLr4cpxWCBM3Tv5/W4SMCjnCykS60x/iNDkvDzAeyQNre1L61DIsYlfpSRBbmVzr+XRqM0WUBHCIIUEcgnpejdK9C51PhmBLzZ5n7l+zBdz0IK496+AqFScTnIzAIl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715759708; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eL11UZGpeVEq4VOMmX63mOyK3p1fvPoFDCh9Izq0OCE=; b=WrCt531YPJgNTJkYEOJxEQT1PQ57Wcl8E+LpmLNpHwyBcLCSawutTfhpQkihw3Mz//PVVEA/R8Mw6x5vdQ9auDleFGuaLnD7F++LchCUGUNzcFxFtywjtkV9ssbFJRsgU7D60yn8eBkSa+QQJTkeDuLhyFUke2vybCbDAuJKNCo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715759708572270.71487375004494; Wed, 15 May 2024 00:55:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s79SH-0005EV-Be; Wed, 15 May 2024 03:53:41 -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 1s79S9-0004zk-02 for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:33 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s79Rq-0001dX-3N for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:29 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-41ffad2426eso48855545e9.3 for ; Wed, 15 May 2024 00:53:09 -0700 (PDT) Received: from stoup.. ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9292sm222611855e9.37.2024.05.15.00.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715759587; x=1716364387; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eL11UZGpeVEq4VOMmX63mOyK3p1fvPoFDCh9Izq0OCE=; b=YqW1ne0wbfEmTAQ6YGipyOh40h3jYChNGgRhu+GhMQRvEpTVQDW2mxy/8hxYmmZNKf 11ysBKHCwSLo3rkiuEN1/gh8jhOZSlCUM+OLtbck4Fpasoi2d+OqQlLwUPB2PPmyU6fK 1jWrr8G5WtIuyWiZ3GvaLZq+e1BUOnfyOIF8+dAlqgOTLgBrYFRn4D4KUM7HSu3I1t1t p7isAXYXhtU2rpULsw1hhoi5bRWZQnjkN01OUwKOeiMifqZZqM/xSuQk44kXpH7DlfI6 aW1KDhpnbDNVtf560UXXl+ivVuNLOIXaf1Tw1i1I9i86MgdN220dlSvGR7ZCgUCiLTk6 AATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715759587; x=1716364387; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eL11UZGpeVEq4VOMmX63mOyK3p1fvPoFDCh9Izq0OCE=; b=D02rpOmMD86Pp6pnvmlil87dWm/9tNVFRFeSAYwbDArYdx/8R1VSVcOVBUiahQnQG6 N6zoOVdhNx5+3b+JiKC/a3gL0uFd/UVfzgr2atH/8rIjbx2F30vHi98LILBbOVfq3TLP SZhooZYwLK9yMrtagByO8glmPnaJBAIID8e3QYJoQPaClc2oWKzRwZ/U5V6HHN6gb0UO D/NXGePrI6b4gFZXI+foHRarwFxKcJs0ScVsgkorpJE/2t1IEsV7kg4MlBph/aNV1bo5 7gRlKZqkDI1qW2WAucUaomFCA0DuIX9bfqJ0UaPTidtt6tvH6K3gieof4ig55hfnagth L1rQ== X-Gm-Message-State: AOJu0Yzh8QEPJNxrli1+F+J7OyDXWwQvKiKZAZwK3GKRdVqL2vznRAMJ tniluRRKtP1gNkW+XJ7MJXHp23mwsmk1Pvk6i3Ic990u/pAc1+StYTpj88fvj5EPJWwmRAnaaeg 3abI= X-Google-Smtp-Source: AGHT+IFWfjLXa9LYDR5qQr8r+P6kEXiByx6F3yXEGMlFhXPunmGheVa47iBiiQ8Xmr+FcQDvAyd7yA== X-Received: by 2002:a7b:cbc2:0:b0:41a:225f:becc with SMTP id 5b1f17b1804b1-41feaa44406mr139063775e9.21.1715759587325; Wed, 15 May 2024 00:53:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: "Edgar E . Iglesias" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 28/34] target/cris: Use cris_fetch in translate_v10.c.inc Date: Wed, 15 May 2024 09:52:41 +0200 Message-Id: <20240515075247.68024-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240515075247.68024-1-richard.henderson@linaro.org> References: <20240515075247.68024-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1715759709145100001 Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/cris/translate.c | 1 - target/cris/translate_v10.c.inc | 30 +++++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index bb2d6612ba..a30c67eb07 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -29,7 +29,6 @@ #include "tcg/tcg-op.h" #include "exec/helper-proto.h" #include "mmu.h" -#include "exec/cpu_ldst.h" #include "exec/translator.h" #include "crisv32-decode.h" #include "qemu/qemu-print.h" diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.= inc index 73fc27c15d..c15ff47505 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -165,20 +165,7 @@ static int dec10_prep_move_m(CPUCRISState *env, DisasC= ontext *dc, =20 /* Load [$rs] onto T1. */ if (is_imm) { - if (memsize !=3D 4) { - if (s_ext) { - if (memsize =3D=3D 1) - imm =3D cpu_ldsb_code(env, dc->pc + 2); - else - imm =3D cpu_ldsw_code(env, dc->pc + 2); - } else { - if (memsize =3D=3D 1) - imm =3D cpu_ldub_code(env, dc->pc + 2); - else - imm =3D cpu_lduw_code(env, dc->pc + 2); - } - } else - imm =3D cpu_ldl_code(env, dc->pc + 2); + imm =3D cris_fetch(env, dc, dc->pc + 2, memsize, s_ext); =20 tcg_gen_movi_tl(dst, imm); =20 @@ -929,10 +916,11 @@ static int dec10_dip(CPUCRISState *env, DisasContext = *dc) LOG_DIS("dip pc=3D%x opcode=3D%d r%d r%d\n", dc->pc, dc->opcode, dc->src, dc->dst); if (dc->src =3D=3D 15) { - imm =3D cpu_ldl_code(env, dc->pc + 2); + imm =3D cris_fetch(env, dc, dc->pc + 2, 4, 0); tcg_gen_movi_tl(cpu_PR[PR_PREFIX], imm); - if (dc->postinc) + if (dc->postinc) { insn_len +=3D 4; + } tcg_gen_addi_tl(cpu_R[15], cpu_R[15], insn_len - 2); } else { gen_load(dc, cpu_PR[PR_PREFIX], cpu_R[dc->src], 4, 0); @@ -1095,10 +1083,10 @@ static unsigned int dec10_ind(CPUCRISState *env, Di= sasContext *dc) if (dc->src =3D=3D 15) { LOG_DIS("jump.%d %d r%d r%d direct\n", size, dc->opcode, dc->src, dc->dst); - imm =3D cpu_ldl_code(env, dc->pc + 2); - if (dc->mode =3D=3D CRISV10_MODE_AUTOINC) + imm =3D cris_fetch(env, dc, dc->pc + 2, size, 0); + if (dc->mode =3D=3D CRISV10_MODE_AUTOINC) { insn_len +=3D size; - + } c =3D tcg_constant_tl(dc->pc + insn_len); t_gen_mov_preg_TN(dc, dc->dst, c); dc->jmp_pc =3D imm; @@ -1164,7 +1152,7 @@ static unsigned int dec10_ind(CPUCRISState *env, Disa= sContext *dc) case CRISV10_IND_BCC_M: =20 cris_cc_mask(dc, 0); - simm =3D cpu_ldsw_code(env, dc->pc + 2); + simm =3D cris_fetch(env, dc, dc->pc + 2, 2, 1); simm +=3D 4; =20 LOG_DIS("bcc_m: b%s %x\n", cc_name(dc->cond), dc->pc + simm); @@ -1185,7 +1173,7 @@ static unsigned int crisv10_decoder(CPUCRISState *env= , DisasContext *dc) unsigned int insn_len =3D 2; =20 /* Load a halfword onto the instruction register. */ - dc->ir =3D cpu_lduw_code(env, dc->pc); + dc->ir =3D cris_fetch(env, dc, dc->pc, 2, 0); =20 /* Now decode it. */ dc->opcode =3D EXTRACT_FIELD(dc->ir, 6, 9); --=20 2.34.1