From patchwork Mon Apr 24 05:40:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 676532 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp1987856wrs; Sun, 23 Apr 2023 22:56:13 -0700 (PDT) X-Google-Smtp-Source: AKy350bfDO7PTgITRYePzKWnpNtgfSh8YpC93oXavLYlNDHjAMpRa1HRgllcACOk4a0KE48smVcL X-Received: by 2002:a05:6214:2305:b0:5ef:9b22:dc88 with SMTP id gc5-20020a056214230500b005ef9b22dc88mr22552936qvb.0.1682315773281; Sun, 23 Apr 2023 22:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682315773; cv=none; d=google.com; s=arc-20160816; b=YhVNCwNPHmcmvbWueah6PJHYHsC6jZjsITezDWBcszO4QK5SPLs9/evcSdEVnpRc5G Rv6WNNucmabkcLK7y15oNt5nkW+om6DgKEmcokddoIoMrX/XZxDEBdU2u2pvbJl8vR22 0MVvk8UQJRfOI52g0EEGHWsrRLvaI3IgF1nR5cUBVOy1FJEChOPbKN5XD4pvWNigz09n HGFml1PCGfZmdCWv/lqPWe6+wA7IgHM1fjPH5BBEm3XTvhYUfIZMPqO9VVoplzzR+UkW Hh6xat+h5Q6NAx/wN6OQOJdTaqrqV+dOnlc1k0L2rma3IL83LfNrV66fphECut9EGvtj Qy1A== 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=8inodTGUilDAhT6OBmWmJGZ3vieMgwqC5uJSdvFYggQ=; b=ZWwZZ81JooD2ZIwgFQztAdVLJXVwBT+DjFFvWlmNE6hZIjbLK50nXbeQFx51d1wE4W d+B9K818vydjPHn4SEbdjltkU4hG7AnpZNRjjp//Gi7OadcAx2KTwroa+J5xw6bMnMgi i1dYaPqwIVP5EGC3EkazvzTrWuD/T5NkvSWyju4ZBdC9Qku/5BgYaMbXumIOn9FkMbIq EZ+omxt81w14AELxC3GQdiAA6wItY6D4pQd8GIQRELSJ14Ep8XijSGu/Iob1YU4x/1x4 6u082Vz0k4icbF4Oms9qqHwPRRn3e5OmV5+MdcgElflfViaiKgS0vLc4q4zGvnmfloqq YwsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W0O7piH6; 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 p4-20020a05620a22a400b0074e005d1f38si6284091qkh.362.2023.04.23.22.56.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2023 22:56: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=pass header.i=@linaro.org header.s=google header.b=W0O7piH6; 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 1pqp2b-0001il-Hz; Mon, 24 Apr 2023 01:47:09 -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 1pqp0L-00060W-Pc for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:44:56 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqp0C-0005J5-SM for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:44:49 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f173af665fso24594205e9.3 for ; Sun, 23 Apr 2023 22:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682315074; x=1684907074; 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=8inodTGUilDAhT6OBmWmJGZ3vieMgwqC5uJSdvFYggQ=; b=W0O7piH6cTojnNHmg9vphLYmUshHUW7mBbal/lE4bxxN/DSCC8RJZy/GjhotqbjuIv tLwYVJHKBnDdCe456zwq/LsVKs6K620bITX45RCDAFrtTiLxHH6i9uPbujyUDXcw5O3C rnS9jxHL8VYl459JT0pE0hrkiy7x4/PTN0j8TQvaBJ/w2PuOpSsJSTIgNhCGyzFP8QVX NBR+BpPvKZXE/y24FwovDyFi/9E7QnCHGs6sCrjarDFhjkYnEuJgiAojGOQt/Jls9Cr2 ZhWe1g26WPDlcHdRZb1zPanHn/FXRm/h4M79W5L+MU9q5tky6kSy1KaXkjQslg5gvUsT lmCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682315074; x=1684907074; 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=8inodTGUilDAhT6OBmWmJGZ3vieMgwqC5uJSdvFYggQ=; b=LJ9d22NqtFioAxAsb95+Q4P4ZmHUUPyZtDSDVg0bmbvXQlkqr0nrXSBxaLAr1ClmZZ zotGXG4dqILBZGjikLFyX95JoUWie0jMBgCBtAwFuzxQut2qIZlfyT9NJlA/96kRCvWF j5y+DxqXAvpkdUt4/j0s24cHJF23t2VEPML7WpAejkstqsSvFaylCy+IJaUEIQY9kzYj +TdStd7N2QlDTe68AjDwnrAJ5LWVEkDL37AE3pzYGQCBKSAplK3nI9jawcDFPTacltoV EfvFlevPZo+00dLadk15Nd/2APFiL7mozDg6badPWVkzaRhzuSpcqc/8wgBaie9A/iz4 FrTg== X-Gm-Message-State: AAQBX9cHMlWZJR1Ms+gLq2J7xnZoEdskQGR2TUVGPydxSheHSC63wsnQ k4pEdy8NpxOL31Mcu6t0FH4vDh6yIj+ahQCxb/Wuxw== X-Received: by 2002:a1c:f601:0:b0:3f1:7331:38b1 with SMTP id w1-20020a1cf601000000b003f1733138b1mr6644941wmc.14.1682315073899; Sun, 23 Apr 2023 22:44:33 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 22:44:33 -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 47/57] tcg/s390x: Convert tcg_out_qemu_{ld,st}_slow_path Date: Mon, 24 Apr 2023 06:40:55 +0100 Message-Id: <20230424054105.1579315-48-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::329; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x329.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. 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);