From patchwork Wed May 3 06:57:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678645 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp907593wrs; Wed, 3 May 2023 00:19:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JPQL1JTBuZYLduCRDwm27VifOqOWSpjETk5uhUMGGyOGhI/NIlwwKA6SYMujlTjUO+Xv4 X-Received: by 2002:a05:6214:23cc:b0:5ef:4441:2a0a with SMTP id hr12-20020a05621423cc00b005ef44412a0amr9392518qvb.32.1683098394425; Wed, 03 May 2023 00:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683098394; cv=none; d=google.com; s=arc-20160816; b=KIqYjYwd7SkLrFzSqSDpQlzYzZSVHT5iCYS47tGi2IHSshYkmV4D9ZO5Rv/ctQguIX rEWlGFitn7bUIib2RgmZ3wo2IkwGOUZ4LjwTEEN/F129CDziBf+0MWP5YNDyPqNgtaIP XPrX5iObFVqP+PPQHSdR2kIxi88a5sbHjg+/0DxPIUkVrB9yPJbPBF1L24iOtBKJOyJS 7hvhmmNAGEn19WBIGiCC0hAaI0LsstbyFR2vnfxjH9t3GoWdR/1mEuJsnuglyy/ApjJ7 qXZ8ukvgLme+x6I7y9BnQNjMnZeKGK2EhL/76RepzBwmOKFv19Cyh0Hi8TgsjU6vtYEC aP+A== 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=mF+HM07xkXH2h99HjcInU2bDka6k00obeRcL7ad8DzGBHJ/MMZu2yjdNpqcCHicHZc ZgHaXrtdbbUZFyehS4epHC+YNUwzNHNMg7Ev6Or+3FzNas/Lhq45HjumzZaQhB4tqqP0 t7FQDNH2VSnCulGOJlcokC1M28aMRlMcP5zFNgjqjPl5M/R7jNpPMHAsKZ+xk357O2NJ SyOR2kXHj8ESnhptIPyLN9oCYSqvbGOWfpuQbits23imeRD8mEzREZrGDXuMOkFIz/iG sVH4UAMh3ciYLPSa37bvVK1KJ0401rn8mCHs+FGK6fVHekmHl6kB31TFZtFArfKWDKoM davA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W6X1s12E; 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 ed14-20020ad44eae000000b005ef641c3b77si18251363qvb.338.2023.05.03.00.19.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:19:54 -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=W6X1s12E; 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 1pu6UO-0006C5-2S; Wed, 03 May 2023 03:01:26 -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 1pu6U8-0005vK-4F for qemu-devel@nongnu.org; Wed, 03 May 2023 03:01:08 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6U5-00038n-9Y for qemu-devel@nongnu.org; Wed, 03 May 2023 03:01:07 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f315735514so10602425e9.1 for ; Wed, 03 May 2023 00:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683097264; x=1685689264; 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=W6X1s12Epb6E4NvukyJ0MF56tETJvNkTiaMLoTLDX2Xy/acGagr3Ho49EeO3Z0UDWu uvTXo9/wVV46SLjemZhwcM0gso4KJDmwWwtffcciVHFgLs8gscIK3/cL9H49ZEr4CeBi xwg8igRa3C7WorAdHDd+Qo1r0pTcZ8+89rQbhPg8Kv91CJ4yxKOWTivOGcapoYWWUI/O decnZJRpfh8tLzFF5hOS2d9RqmVo1/nTbTeUSxwEAt73SThVZuZnw5l8Yr34jOpvSIbo r+jSsyAZmUwwR9ba+FiPiiGOQsQlu/FfZsBbq0jdHYsm8Jj77KilRnQGe3gKAniw4gHM RmGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683097264; x=1685689264; 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=FxsuLvG8CNa4pBQdTpViYCT7AfL5cfAiyn6B1K7u8IWvFq40H/ZW3Et7mvNsAO7Aie WChgAopqRIDFeYmg3mnaAAPmflQJyj+LSVJhrBZpI5FPnq50rPSVAx+h1pFoEm74tP0F Haa7GiT3oD0T5MD3rRsrc10zbbHZ0xcZclrMso5Qtps2n1hK3JQB8SHQmm6GDjbKV2ij I9pSg4tYt5JptXutRfnvcjnxBE18ekwzCHA2p3d3zJawemjfiZkYOJHYha5RFv/Tkv0e DlgAf7UkWO2pqzrKLG/8sB5nYieE9d4moi/pp84KOFw17vpB2PoJswnNEJ7wv3Daelnd zYQg== X-Gm-Message-State: AC+VfDwUaLbx4Rh6n77gUjuFMLD+BGw1OqoH+k69fZcAmfDKGB8yMnY/ g+y8RJk9GfGFCyb590pEGkCSCh/NoUwRiC+S5cLfww== X-Received: by 2002:a05:600c:248:b0:3f1:7287:55ad with SMTP id 8-20020a05600c024800b003f1728755admr699863wmj.10.1683097263873; Wed, 03 May 2023 00:01:03 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id l2-20020a1ced02000000b003f19b3d89e9sm905035wmh.33.2023.05.03.00.01.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:01:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: git@xen0n.name, philmd@linaro.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH v4 43/54] tcg/s390x: Convert tcg_out_qemu_{ld,st}_slow_path Date: Wed, 3 May 2023 07:57:18 +0100 Message-Id: <20230503065729.1745843-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503065729.1745843-1-richard.henderson@linaro.org> References: <20230503065729.1745843-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x332.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);