From patchwork Wed Apr 24 23:31:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791587 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1106366wrq; Wed, 24 Apr 2024 16:33:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUq3XOUv3u8wT0lih4TRWoMx50VQEcnFMzqHdPE1eHrfj4a7oCuNPj6R868JQk+VV/84OV+P+cmhjs+amJUgARH X-Google-Smtp-Source: AGHT+IFWXPfemV+XGCyNmXsadU0zbVG3YYYPT5vPLl51ZAms/TJ1i9KYz4s01EyJXRGV/yxTWLiv X-Received: by 2002:a05:622a:c2:b0:437:a0fc:8aaa with SMTP id p2-20020a05622a00c200b00437a0fc8aaamr2179206qtw.23.1714001595872; Wed, 24 Apr 2024 16:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714001595; cv=none; d=google.com; s=arc-20160816; b=GUBdaB1lCWGdGP+caus/yw8P6zjowDQG9A4B7qT4C8ToUazLPmdUk41doC/KF/lMv8 +7ehPjc3b5lM4bV+QSk30ef+6ZAAVRI3SlHRuMFuS9MK9CFeuPMx7tw/uwBchoUgdxSs Ss+VAhkgCfOhmzzRt4fVZ5Ubct/P3uTZ5ZB7BKtfMJYTrd+2brV7UZiItgQUITwuo+F6 prxvImMs7IwnBN2OQthJroXnpPyAPCVEh+XI7olWGvYArXxtby4e1eBjUY+7OzMuaMBJ mg16Wz4BYSt5DdHqzawprQj0t7BQ9qa5IUBZmL/NAzxhgGcyY36+jPEx84QAjKlxuJKF yKUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=abuDTzJtuHQkleQ2JIJcQY+Wz/0ibhtmXe6lLhOCiLw=; fh=BCLN+t2ZqfLIJQawKoImfSYKBLl07s8FDPr8BfggRIo=; b=TjQPTq61J5GrirrTFuaKjxAmKroGPcnqkbswXYatUTTUVf/kcqkw3xzK2rrbNozW17 tWg524JMsFvNXFl2n2szqIL3RQzVyuk+WYBjqIIk8hHnEh9B97gHzuXE3H8C8EeV5L8a rEtZwFLz8OG5H0NQ6PSkZ5ue6yCPq9miO79TkrOsnABCVxYobzc3NsmPSapMwM10FxvA TOD0G3xcHohQ6yVpAH6Jvxbs4nenNUCCKRtuG+k76RNlW/L0shD2kq2vY2Si10QAaPXz gpP25oJYEZ5IK945Sv9AgOKkABubTrnkqeztBtmGBi0PjBKqXrpZUCz0nqZDdUe1qRuB kbvg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yVyMBiBM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d21-20020ac85ad5000000b00434663eb379si16340720qtd.638.2024.04.24.16.33.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 16:33:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yVyMBiBM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzm62-00064J-CM; Wed, 24 Apr 2024 19:32:14 -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 1rzm5q-00060x-Gm for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:32:02 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzm5o-0003u3-HT for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:32:02 -0400 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5c66b093b86so1176397a12.0 for ; Wed, 24 Apr 2024 16:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714001519; x=1714606319; 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=abuDTzJtuHQkleQ2JIJcQY+Wz/0ibhtmXe6lLhOCiLw=; b=yVyMBiBM0Zuq2mOa8apAYdprlW2l3d76enipPb+/VA3QDFxzSdxd38qGjWi3irYx7f VD/JYH2UlTueZDdHgxrwvPz+9JfOumkG6QjDzQ74Xpku878rVNtnEefOu9tH5fkVd91o p7xAnxKrESUDNk5rnCS9pZuN1QGBS8GXmCz/aPrbI0sbwc+BW3Pi0nJwP8Fl63BiIOn8 9HPVu3qLl2Cz0SGj54NKq/bYwfb7jXoopdGp/CAIkYB5lYl9rdl0MIr/a2CEGAoUWrkg F8XgVnONJ5bRLaEYfeAQLot2rD1GYL7D24ZshSm2Pa0M8/yELFMu8FTIX6tsYXW5tY7J 8OyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714001519; x=1714606319; 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=abuDTzJtuHQkleQ2JIJcQY+Wz/0ibhtmXe6lLhOCiLw=; b=CpbTDK8GRUmdlvtC1R6H/apzdNdSeh1Xux2DAoxIE+qEDETALor+kNfzU8jjvyKRRj eWWPiP8V350wtPkm36/hAdHsb6osj5CZthKEZwREZiUN+QN1O1CtekKLxI778/5bPkIv gtl141mT/eEgcqsEkdq5jGQucU8zFYccMbzL+jEVDc4wtArBEurrtcqMzd7KuLK7vgDL r76Ud6ipM8SqnPiSf3QpRrPNDGZP5PXb9wAmBmFlWO23oAc87fHof1wF9CxLzEjmzcW2 QMJOU1Sq6Z9yHkeW0vDA7pSOi06ELjbGJ0Fv/kh/wcdbe5y3yuTqdm4wEdzqnrlYit04 cYoA== X-Gm-Message-State: AOJu0YwMoNSl00p8BEwNNFhfL+7TteeAClxnJV4hKqOC2ROlK9Tmourn ooo278iNmc5KDBCR+4oHBs37Js5vS8yhutaOiwcYL8+L//pWwO9xIJsltGIpuUWmEuxnxqGS1pv v X-Received: by 2002:a17:90a:6d02:b0:2aa:90f3:a4b8 with SMTP id z2-20020a17090a6d0200b002aa90f3a4b8mr1486785pjj.24.1714001519370; Wed, 24 Apr 2024 16:31:59 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id z24-20020a17090abd9800b002a56b3931dfsm11737859pjr.49.2024.04.24.16.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:31:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Yoshinori Sato , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH v2 30/33] target/rx: Use translator_ld* Date: Wed, 24 Apr 2024 16:31:28 -0700 Message-Id: <20240424233131.988727-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424233131.988727-1-richard.henderson@linaro.org> References: <20240424233131.988727-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé 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)