From patchwork Thu May 11 08:04:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 680895 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp3269153wrs; Thu, 11 May 2023 01:16:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5L7Lv5WhoA4EhaDA5EzAK/7CjtaNnMEJmkU1jJiIO1Y9muL0csRKbDMGpXCZjINWNmRK+N X-Received: by 2002:a05:6214:518c:b0:5ef:4823:a949 with SMTP id kl12-20020a056214518c00b005ef4823a949mr28090693qvb.45.1683793008657; Thu, 11 May 2023 01:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683793008; cv=none; d=google.com; s=arc-20160816; b=r3zEoH2rXIYorIRhJoYh7OnQCZWzWXPLHW1WQgeUKvWs3e+EgTLhq883K1Y06DGTGB ZAoE6ex9tRW4GZgSzZo8K3SYBrFBsQrBg44UQmAEHVIyMt1r7LtAPjNROhIjT+biQ5lz 3edVu2nm4QT3C/A4AKFDrP5k3X3BCCDQpQMi5DomZTSI+KaKfDuxU6z+9+TZ1otsbnx/ 9Q2NKFfW8sVcwQApU1tQL6L8DBH+uMkklFwJOmIuaaUOIhrQLz8Y55TLhaVlk5YeA36B QWtOc4wC6/OomsEY3tfjDPMYGzk5wIZTEl/EFXOMW1AAFuRBiUcGvWl6BOdb/l6W7I9s 8hKA== 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=bppub7FI4906pQ2iK4M9ZUhUq2k0xoIDRWcVIzCDJ2k=; b=oWiNe32rUMCgwK8s3YXOWy3yUxG96G2pg2E4MGcLuZCaH22lQ5KTrmI/zA1Nf+0PAG d+KA+cpJe/aZGSjBYTnQ7nq3qSVhoKe53fUXcoKV/L1YR/2ncC5jxwx8+H+BlENC8L5X /lE9St0zg07er/9FZ6tGcuHCy5mXqq0C+PlP1GofaYY+nt71SUE+agf+El9l0tzJCjIT +zuBX3htpzqspLaqcCdMynHmeBtO7dqcNYAwAXsFupN5Zd6sycBI7dyouOn45XbDvbiv l44JaMCKwjM1+c+wWZ+hbkSJiwpk9nVmLZrsYyWudr6N7e70AewwZvGe+gHfCWbPaD2x Bu7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BBVLraMN; 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 x8-20020a05620a12a800b0075164d077casi6367326qki.625.2023.05.11.01.16.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 May 2023 01:16:48 -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=BBVLraMN; 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 1px1Ir-0006xp-CX; Thu, 11 May 2023 04:05:33 -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 1px1If-0006RH-Pe for qemu-devel@nongnu.org; Thu, 11 May 2023 04:05:24 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450: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 1px1IV-0000x2-6F for qemu-devel@nongnu.org; Thu, 11 May 2023 04:05:21 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-50db7ec8188so4837329a12.2 for ; Thu, 11 May 2023 01:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683792310; x=1686384310; 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=bppub7FI4906pQ2iK4M9ZUhUq2k0xoIDRWcVIzCDJ2k=; b=BBVLraMNAhzMjSmnZ36WBRQQ3q+6VElhcpc7+MBAc/Iz/Ltn43LFukAzwrpOCWlyUv FBeQrIjdjVFDz4C06nIVGd729E5i2P1+9Lvlk6XyWPDOE7BLEOncuhQusF2mPvMsKoXK Xa7SblB++aqbBbwFSvMsuBaB13PrYBk8iVVCJOFidpEauf4rd0ckHTfU7UPVb7Vg1vEg PLnm3dqtYf2vg97sURXfyplIvZPu0MWyGkw3eOPtSX/zTiak4PowAlMLDN+dHaHhdRnv 9CFd/a/QuCzAh5xP34JGz3MLGCHBGTObLERoEO5q9/Tjr4XPQ8lMxEd54CA40mUVLoEn 8tHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683792310; x=1686384310; 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=bppub7FI4906pQ2iK4M9ZUhUq2k0xoIDRWcVIzCDJ2k=; b=UVonrwNm42iq7eb0PDBU/IiKdr6BpRizVN/pq0/nEaPfJgPoQr5+Oat60BvoKimbfC pe/uqI06Ec/deYeRg1pz4glU/Dq1K5BjsiTrCf3vxGhM80u+Ne4LXvkR2W6x9UUnjBAG rC8IfOdb/HHd1d0Yw4+SkHqMhytWvkEcaUWIKYW9gwUmDk6L0/HPIY7OamyzS0YZk4a7 GhtOKtZYYHKf3irC4oTDj/Cu8lZx6eq/DjbKCKmBzuF2NRC9dfMpeQxmw6FfofJpAxBF xsJ9oR/VQsvx7FJdC3t0ZuoeISALNGIyATB6x8kx6bb9oZlsWeUocNeugjeyAwU3ZJPW Z5zw== X-Gm-Message-State: AC+VfDzmMDcNxoM3W2gYgkT7mhu4vC3M20gimCyrgDeYx3v7kkW89Vyn GPWzqMP9hb13TbQROQntnwZQeoQoPvUpUyCXEGE7tg== X-Received: by 2002:a50:fa86:0:b0:508:41df:b276 with SMTP id w6-20020a50fa86000000b0050841dfb276mr16865875edr.22.1683792310409; Thu, 11 May 2023 01:05:10 -0700 (PDT) Received: from stoup.. ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i12-20020aa7c70c000000b0050bd7267a5csm2662095edq.58.2023.05.11.01.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 01:05:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 29/53] tcg/s390x: Convert tcg_out_qemu_{ld,st}_slow_path Date: Thu, 11 May 2023 09:04:26 +0100 Message-Id: <20230511080450.860923-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511080450.860923-1-richard.henderson@linaro.org> References: <20230511080450.860923-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-ed1-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Use tcg_out_ld_helper_args, tcg_out_ld_helper_ret, and tcg_out_st_helper_args. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index c3157d22be..dfcf4d9e34 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -1718,26 +1718,22 @@ static void tcg_out_qemu_st_direct(TCGContext *s, MemOp opc, TCGReg data, } #if defined(CONFIG_SOFTMMU) +static const TCGLdstHelperParam ldst_helper_param = { + .ntmp = 1, .tmp = { TCG_TMP0 } +}; + static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) { - TCGReg addr_reg = lb->addrlo_reg; - TCGReg data_reg = lb->datalo_reg; - MemOpIdx oi = lb->oi; - MemOp opc = get_memop(oi); + MemOp opc = get_memop(lb->oi); if (!patch_reloc(lb->label_ptr[0], R_390_PC16DBL, (intptr_t)tcg_splitwx_to_rx(s->code_ptr), 2)) { return false; } - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_R2, TCG_AREG0); - if (TARGET_LONG_BITS == 64) { - tcg_out_mov(s, TCG_TYPE_I64, TCG_REG_R3, addr_reg); - } - tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R4, oi); - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R5, (uintptr_t)lb->raddr); - tcg_out_call_int(s, qemu_ld_helpers[opc & (MO_BSWAP | MO_SSIZE)]); - tcg_out_mov(s, TCG_TYPE_I64, data_reg, TCG_REG_R2); + tcg_out_ld_helper_args(s, lb, &ldst_helper_param); + tcg_out_call_int(s, qemu_ld_helpers[opc & (MO_BSWAP | MO_SIZE)]); + tcg_out_ld_helper_ret(s, lb, false, &ldst_helper_param); tgen_gotoi(s, S390_CC_ALWAYS, lb->raddr); return true; @@ -1745,25 +1741,14 @@ static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) { - TCGReg addr_reg = lb->addrlo_reg; - TCGReg data_reg = lb->datalo_reg; - MemOpIdx oi = lb->oi; - MemOp opc = get_memop(oi); - MemOp size = opc & MO_SIZE; + MemOp opc = get_memop(lb->oi); if (!patch_reloc(lb->label_ptr[0], R_390_PC16DBL, (intptr_t)tcg_splitwx_to_rx(s->code_ptr), 2)) { return false; } - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_R2, TCG_AREG0); - if (TARGET_LONG_BITS == 64) { - tcg_out_mov(s, TCG_TYPE_I64, TCG_REG_R3, addr_reg); - } - tcg_out_movext(s, size == MO_64 ? TCG_TYPE_I64 : TCG_TYPE_I32, - TCG_REG_R4, lb->type, size, data_reg); - tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_R5, oi); - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R6, (uintptr_t)lb->raddr); + tcg_out_st_helper_args(s, lb, &ldst_helper_param); tcg_out_call_int(s, qemu_st_helpers[opc & (MO_BSWAP | MO_SIZE)]); tgen_gotoi(s, S390_CC_ALWAYS, lb->raddr);