From patchwork Mon Apr 24 05:40:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 676504 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp1986361wrs; Sun, 23 Apr 2023 22:50:04 -0700 (PDT) X-Google-Smtp-Source: AKy350anYVkibyLOm4tRPqIoIive365PFfsqdZsULbB0JOTIKrlcTyR26vuhJHBmcGs0JY/MUeBM X-Received: by 2002:ac8:5987:0:b0:3ef:3679:96fb with SMTP id e7-20020ac85987000000b003ef367996fbmr19146815qte.3.1682315403857; Sun, 23 Apr 2023 22:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682315403; cv=none; d=google.com; s=arc-20160816; b=dg6ZHhxJJCHvW+G1MLlNu1VwPsErE88VJNvAKEMytmeWpxk7dWg/B2Vz+Z9oJRGOec voqt43ZnPMIIU0lqlXfuDQW2TZNaxJUZAi6KfKvjRcXt1EvwgenIY2gOs0icZ1jyWXvJ WQUtnrqSQyNv2r2QyksW1LDh6Mz1+tsjkrl5hZFYxT9LK+K7oRVRIIAaAYQdAK8DyiHv e7k2He2JN6gQFmF0d1PgjM/ka8+z+ISFpPCDvj2iX71XSMumPC8qOyxSI340Si//gfmz EhDwBoqM7DkKD5TQjWxN3zZcQFToKtnPLU88lnPB9hxUX2rSjEgBdCpU39pM9zd/HmFP kV8g== 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=WIdMYknenlDL6zEabJSzjI8eOseBt6FLgSg6Xk98IsQ=; b=i9KO3yaLC1ZRFkJbUl6W0E1zVvnOMTVAmmc8kD7hFzkpml7UpBV8fJGie1Z+dV/yra xWsxWMZylhkprgKEHaIHKSKM774rIDqEmdBVORyXyXbHO1g+1Ein1oZvQk4odBrgXBqE L2Iq/C0ILkADM87ggDwtAgjrrvqqxBAcJzxwXsatWGAmmhnbUn3/F/Ye4puOfoYYKXbF 9kN7EA7m6o8/0lCf5CdAs9wgYc9qrIrIYeaG7vEydSFyM8hlFbfa3m0lkMs51b45QPxr uEIU+xH9dmFUwZJ0oz6zE2S15qkbdRV6WtxZyBDBpTlJKXbUbLaHrJ8CrRJBwVzVj1pW 8qBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="rVKPE3y/"; 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 c18-20020a05622a059200b003ec4920d5a3si2611527qtb.194.2023.04.23.22.50.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2023 22:50:03 -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="rVKPE3y/"; 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 1pqp2Y-0001Af-S8; Mon, 24 Apr 2023 01:47:06 -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 1pqp0G-0005x6-2N for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:44:45 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqp05-0005HE-5I for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:44:40 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f19ab99540so16201865e9.2 for ; Sun, 23 Apr 2023 22:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682315071; x=1684907071; 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=WIdMYknenlDL6zEabJSzjI8eOseBt6FLgSg6Xk98IsQ=; b=rVKPE3y/e4mhwCnHFohU2X/wnxZd40F4yQyJ9ssQN+TqCdTmPfdfeqt3x+JVD/OTS6 mFiGgDyY4qshaxzKI2WzX5BBCcHidS27Hzf3yIiS1ncByqFp9/iBdU1Ya8m/BSDP4kRe /dXqr1VlRNCi810rY/J61yBLzDz1UO1nt5WTmP9c0iSXJMAMhUMgBQi8trIOOD10HJbB 0uaMMexDMpMWou3PlzT8oCoMUfG0fWxNUsoC9WBxMMwoLCVFoAsHtF39DA+WT2NfTzTh GUMshHCe502HG1RTkV5HD+C7yF6PIRDi2tG4yb+B0lZF4KuIcdXRUz6qIaFzyGZDQsO5 deTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682315071; x=1684907071; 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=WIdMYknenlDL6zEabJSzjI8eOseBt6FLgSg6Xk98IsQ=; b=AElg9uQVnodk9crRLC71Ev5q6NIl6gi6wU4437dSh/RWVTRrijZgq/zCxyTl9t3rw7 oKqDrW/BP/0Z1XciMnDrwS4NawP0PNoBBe57rK9Yg+T7g3tNPMflBPGq2Y+qRjAWvgs1 VGyOAlO7iNcTTu4WbL2wNpAmdrq+usaXU5OeHrmpyt5wgH1rDZBRg4y7znpf1ZlL+387 SfRtSJ2XXbhsr5y7/FZSzX0U67fYRBEl2RNV8J+dt/1TvdshliEjeVQwG0LQdUSKDI7+ yEJhj64OgKlymKh+gpVS10wJ2stsS0E7kGfOXkrh9ACIHPtb84SSp4C1kblUgm7jc4S+ 4zsA== X-Gm-Message-State: AAQBX9fhH8lsoz4fJ2kFtZxtct/YjLBquRhKHKABS9asOnQo/tEnJtgb 4iJbi5I2g1fwl2QbqcNR4NMrCPBrgKFvolvWgErv4w== X-Received: by 2002:a5d:4c49:0:b0:2fb:f93f:b96 with SMTP id n9-20020a5d4c49000000b002fbf93f0b96mr9232857wrt.31.1682315071688; Sun, 23 Apr 2023 22:44:31 -0700 (PDT) Received: from stoup.c.hoisthospitality.com (cust-west-loneq8-46-193-226-34.wb.wifirst.net. [46.193.226.34]) by smtp.gmail.com with ESMTPSA id u6-20020adff886000000b002f7780eee10sm9986693wrp.59.2023.04.23.22.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 22:44:31 -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, git@xen0n.name, jiaxun.yang@flygoat.com Subject: [PATCH v3 43/57] tcg/loongarch64: Convert tcg_out_qemu_{ld, st}_slow_path Date: Mon, 24 Apr 2023 06:40:51 +0100 Message-Id: <20230424054105.1579315-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230424054105.1579315-1-richard.henderson@linaro.org> References: <20230424054105.1579315-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 Use tcg_out_ld_helper_args, tcg_out_ld_helper_ret, and tcg_out_st_helper_args. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 37 ++++++++++---------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 2f2c34b930..60d2c904dd 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -824,51 +824,36 @@ static bool tcg_out_goto(TCGContext *s, const tcg_insn_unit *target) return reloc_br_sd10k16(s->code_ptr - 1, target); } +static const TCGLdstHelperParam ldst_helper_param = { + .ntmp = 1, .tmp = { TCG_REG_TMP0 } +}; + static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l) { - MemOpIdx oi = l->oi; - MemOp opc = get_memop(oi); - MemOp size = opc & MO_SIZE; + MemOp opc = get_memop(l->oi); /* resolve label address */ if (!reloc_br_sk16(l->label_ptr[0], tcg_splitwx_to_rx(s->code_ptr))) { return false; } - /* call load helper */ - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_A0, TCG_AREG0); - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_A1, l->addrlo_reg); - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_A2, oi); - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_A3, (tcg_target_long)l->raddr); - - tcg_out_call_int(s, qemu_ld_helpers[size], false); - - tcg_out_movext(s, l->type, l->datalo_reg, - TCG_TYPE_REG, opc & MO_SSIZE, TCG_REG_A0); + tcg_out_ld_helper_args(s, l, &ldst_helper_param); + tcg_out_call_int(s, qemu_ld_helpers[opc & MO_SIZE], false); + tcg_out_ld_helper_ret(s, l, false, &ldst_helper_param); return tcg_out_goto(s, l->raddr); } static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l) { - MemOpIdx oi = l->oi; - MemOp opc = get_memop(oi); - MemOp size = opc & MO_SIZE; + MemOp opc = get_memop(l->oi); /* resolve label address */ if (!reloc_br_sk16(l->label_ptr[0], tcg_splitwx_to_rx(s->code_ptr))) { return false; } - /* call store helper */ - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_A0, TCG_AREG0); - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_A1, l->addrlo_reg); - tcg_out_movext(s, size == MO_64 ? TCG_TYPE_I32 : TCG_TYPE_I32, TCG_REG_A2, - l->type, size, l->datalo_reg); - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_A3, oi); - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_A4, (tcg_target_long)l->raddr); - - tcg_out_call_int(s, qemu_st_helpers[size], false); - + tcg_out_st_helper_args(s, l, &ldst_helper_param); + tcg_out_call_int(s, qemu_st_helpers[opc & MO_SIZE], false); return tcg_out_goto(s, l->raddr); } #else