From patchwork Tue Apr 11 01:04:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 672335 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp539622wrx; Mon, 10 Apr 2023 18:19:13 -0700 (PDT) X-Google-Smtp-Source: AKy350biA6he+96lF+Sc5m37pE0WisRzsrOAp9xHwURsyBudZol1hDDrUjs0KcK1hiKL1M4kNkYp X-Received: by 2002:a05:6214:234b:b0:5a9:129:c704 with SMTP id hu11-20020a056214234b00b005a90129c704mr15652361qvb.9.1681175953307; Mon, 10 Apr 2023 18:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681175953; cv=none; d=google.com; s=arc-20160816; b=iBuILgobuRLd0MzSv8paMr+7wkuYpEKn5VRm2W5taaiFsuZhcQOPL3BF0win/OyHqH H7FwpHv3hKOHhFKqtCoQa6uVB5/SfvKc6LZyLuePoS9aVeRMDPAryEOlD/K2m1FBKoz8 JnbWK5ByOF/VoDGREqgyaMqGG8gUSQXtMaowzKVpyG/MrDrIN+zBlmwiEZeBQXgb2e+E Vme1g0h/EesyWNBl0nMIh7QdZjO4i0uh9lKdztoyyoivCuuxqC/u+pqDT3Q8O9EU0zPb P9BZ2PFdil0WxSeK6XoO7lB9idNdgFpRSVi+Sd7RLv6/FCnlKODgQpTZxRiPGj301WwC xOjQ== 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=FiOY1i4B1cEP4NOTlXXKaOmijImJBQ0KrqKCcc9XMSM=; b=L+l2xPn9krkJx+6uON4sw2tqEfbseabASq1ODYTpe0TRHClFz0yw9LW/YjZvdIdchr fMiUWsFULVNQ13ShW3myjboYG3EoTxzd8NmiUJPp6S5fotxbHAYyAyN8L98w+IPHwgZK 89fndBjGQsL11e4TDwlOh+Esh2tr5LBFlXa1pHDqxj/85vbmHBOHXinSkuFZIU+JdiLo UZcqic3MJcXlnQeUznhgBGDhUN9TVZmt0GcOKtZVuu0DFKw0dbbVmvIzSrRzzYgmnED5 KBRLWus1rGYTJOuN9NYz26LmokXsIGJXh75O7nO07DQoMyNy7CCjew1gkqN6taUVuEwi Bobg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="N/LHwF/1"; 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=fail (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 r5-20020a056214212500b005d5b24bb6desi8913968qvc.233.2023.04.10.18.19.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Apr 2023 18:19:13 -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=fail header.i=@linaro.org header.s=google header.b="N/LHwF/1"; 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=fail (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 1pm2St-0005Tq-Vo; Mon, 10 Apr 2023 21:06:32 -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 1pm2Sk-00050y-L5 for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:06:23 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pm2Si-0000i0-Al for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:06:22 -0400 Received: by mail-pl1-x629.google.com with SMTP id ik20so6145247plb.3 for ; Mon, 10 Apr 2023 18:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681175179; 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=FiOY1i4B1cEP4NOTlXXKaOmijImJBQ0KrqKCcc9XMSM=; b=N/LHwF/1PDgSMLYBwLwUTAxJUsY6MHIfiPWRdPPSY12mvP2z/yGDtXEQ/H0jVUFVCd HG7HCCtVdW9Zh2KhDR0J5bjLimvc+CnQxXh8KvgvziD2kuo7MGT4X8TCn/35t3e7lZ4y pXAfhXk3Pkbqn6woOGwKeF00Xk8GkftZmIfUgTQ530MhxQgjyjb2HviuaZjK20F+uR21 AiYwYaGtZxuj5wY3Uvjjsc49Qk6+Vq6FZfyeAf836ph4pTqalPzATWijtQeYw/xjBQUe 5BciEISPbvx0DfwAxZUBvHggT39dC+hbPvNipgkm7oOk+PxmL5o9XhR/ZnPfZBcDrZiM S92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681175179; 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=FiOY1i4B1cEP4NOTlXXKaOmijImJBQ0KrqKCcc9XMSM=; b=SZD1hp9lGCeV/Zx99CL/u1cO+05XDNYjG9+BbohscIKw0JddDfs0TaqEvSRpE0oDHS fKZgkr24NMNAyGRKGufBdXUtGMfVWH+e0rohy5rOsA06xeuBegbhpIPjws+6l8uVbr3O vHTcyeh/RTG/OfzHgd3vUPxQEFad0CNhYFrnTV0H5DuPKXlBC8brx8Vsyjc3b20dOJT8 XXjQAHbIktE9RMKudYSbrWZdABPBqOd8juVLmdPNw3M4sOC3A37StRLXwchb2p0G/q2c V8+fCo/ecOa+PEpV4/ZqrJX7/jkCnW0YeaW4H4pm9Maf50h6GELHWxGJbgfIyqBWYcl2 1TNg== X-Gm-Message-State: AAQBX9ejKsUU72EPZftNxcNxCwB0f0eqSTBF2U87NajM+k9mM5Zy9jwg 4blsfjhB/r7NcecboYvODWFCuzDlYeSiadB/B8L0Sg== X-Received: by 2002:a17:902:e549:b0:1a5:2809:97f3 with SMTP id n9-20020a170902e54900b001a5280997f3mr10278315plf.14.1681175179540; Mon, 10 Apr 2023 18:06:19 -0700 (PDT) Received: from stoup.WiFi.IPv4InfoBelow (h146.238.133.40.static.ip.windstream.net. [40.133.238.146]) by smtp.gmail.com with ESMTPSA id s10-20020a65690a000000b0051b0e564963sm1320291pgq.49.2023.04.10.18.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 18:06:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 21/54] tcg/aarch64: Rationalize args to tcg_out_qemu_{ld, st} Date: Mon, 10 Apr 2023 18:04:39 -0700 Message-Id: <20230411010512.5375-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411010512.5375-1-richard.henderson@linaro.org> References: <20230411010512.5375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, SUSPICIOUS_RECIPS=2.51 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Mark the argument registers const, because they must be passed to add_qemu_ldst_label unmodified. Rename the 'ext' parameter 'data_type' to make the use clearer; pass it to tcg_out_qemu_st as well to even out the interfaces. Rename the 'otype' local 'addr_type' to make the use clearer. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/aarch64/tcg-target.c.inc | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 4ec3cf3172..251464ae6f 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -1850,23 +1850,23 @@ static void tcg_out_qemu_st_direct(TCGContext *s, MemOp memop, } } -static void tcg_out_qemu_ld(TCGContext *s, TCGReg data_reg, TCGReg addr_reg, - MemOpIdx oi, TCGType ext) +static void tcg_out_qemu_ld(TCGContext *s, const TCGReg data_reg, + const TCGReg addr_reg, const MemOpIdx oi, + TCGType data_type) { MemOp memop = get_memop(oi); - const TCGType otype = TARGET_LONG_BITS == 64 ? TCG_TYPE_I64 : TCG_TYPE_I32; + TCGType addr_type = TARGET_LONG_BITS == 64 ? TCG_TYPE_I64 : TCG_TYPE_I32; /* Byte swapping is left to middle-end expansion. */ tcg_debug_assert((memop & MO_BSWAP) == 0); #ifdef CONFIG_SOFTMMU - unsigned mem_index = get_mmuidx(oi); tcg_insn_unit *label_ptr; - tcg_out_tlb_read(s, addr_reg, memop, &label_ptr, mem_index, 1); - tcg_out_qemu_ld_direct(s, memop, ext, data_reg, - TCG_REG_X1, otype, addr_reg); - add_qemu_ldst_label(s, true, oi, ext, data_reg, addr_reg, + tcg_out_tlb_read(s, addr_reg, memop, &label_ptr, get_mmuidx(oi), 1); + tcg_out_qemu_ld_direct(s, memop, data_type, data_reg, + TCG_REG_X1, addr_type, addr_reg); + add_qemu_ldst_label(s, true, oi, data_type, data_reg, addr_reg, s->code_ptr, label_ptr); #else /* !CONFIG_SOFTMMU */ unsigned a_bits = get_alignment_bits(memop); @@ -1874,33 +1874,33 @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg data_reg, TCGReg addr_reg, tcg_out_test_alignment(s, true, addr_reg, a_bits); } if (USE_GUEST_BASE) { - tcg_out_qemu_ld_direct(s, memop, ext, data_reg, - TCG_REG_GUEST_BASE, otype, addr_reg); + tcg_out_qemu_ld_direct(s, memop, data_type, data_reg, + TCG_REG_GUEST_BASE, addr_type, addr_reg); } else { - tcg_out_qemu_ld_direct(s, memop, ext, data_reg, + tcg_out_qemu_ld_direct(s, memop, data_type, data_reg, addr_reg, TCG_TYPE_I64, TCG_REG_XZR); } #endif /* CONFIG_SOFTMMU */ } -static void tcg_out_qemu_st(TCGContext *s, TCGReg data_reg, TCGReg addr_reg, - MemOpIdx oi) +static void tcg_out_qemu_st(TCGContext *s, const TCGReg data_reg, + const TCGReg addr_reg, const MemOpIdx oi, + TCGType data_type) { MemOp memop = get_memop(oi); - const TCGType otype = TARGET_LONG_BITS == 64 ? TCG_TYPE_I64 : TCG_TYPE_I32; + TCGType addr_type = TARGET_LONG_BITS == 64 ? TCG_TYPE_I64 : TCG_TYPE_I32; /* Byte swapping is left to middle-end expansion. */ tcg_debug_assert((memop & MO_BSWAP) == 0); #ifdef CONFIG_SOFTMMU - unsigned mem_index = get_mmuidx(oi); tcg_insn_unit *label_ptr; - tcg_out_tlb_read(s, addr_reg, memop, &label_ptr, mem_index, 0); + tcg_out_tlb_read(s, addr_reg, memop, &label_ptr, get_mmuidx(oi), 0); tcg_out_qemu_st_direct(s, memop, data_reg, - TCG_REG_X1, otype, addr_reg); - add_qemu_ldst_label(s, false, oi, (memop & MO_SIZE)== MO_64, - data_reg, addr_reg, s->code_ptr, label_ptr); + TCG_REG_X1, addr_type, addr_reg); + add_qemu_ldst_label(s, false, oi, data_type, data_reg, addr_reg, + s->code_ptr, label_ptr); #else /* !CONFIG_SOFTMMU */ unsigned a_bits = get_alignment_bits(memop); if (a_bits) { @@ -1908,7 +1908,7 @@ static void tcg_out_qemu_st(TCGContext *s, TCGReg data_reg, TCGReg addr_reg, } if (USE_GUEST_BASE) { tcg_out_qemu_st_direct(s, memop, data_reg, - TCG_REG_GUEST_BASE, otype, addr_reg); + TCG_REG_GUEST_BASE, addr_type, addr_reg); } else { tcg_out_qemu_st_direct(s, memop, data_reg, addr_reg, TCG_TYPE_I64, TCG_REG_XZR); @@ -2249,7 +2249,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, break; case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - tcg_out_qemu_st(s, REG0(0), a1, a2); + tcg_out_qemu_st(s, REG0(0), a1, a2, ext); break; case INDEX_op_bswap64_i64: