From patchwork Mon Apr 24 05:41:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 676521 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp1987194wrs; Sun, 23 Apr 2023 22:53:30 -0700 (PDT) X-Google-Smtp-Source: AKy350YDIAFiTQQl6XmVsilM8lC1ndQUNs/zzxDSnbMyUP/nTJcB1CgfD5eQCRHyZvZRLubiv3N/ X-Received: by 2002:a05:6214:528d:b0:5ef:43e5:d231 with SMTP id kj13-20020a056214528d00b005ef43e5d231mr19577190qvb.36.1682315609837; Sun, 23 Apr 2023 22:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682315609; cv=none; d=google.com; s=arc-20160816; b=np8QyJ0sPLJwPgF/DwvIpq10TbFN4U7YKa8Rxt61/3zU5+WhlnE86MmAbwE/2yvXeB m3dYiRoky8L/5py88wZg/7NdyQ7r4nGjEtHaGZk9NQRfW516NxrU0RH0/3ZdTYaMJOCN dQInutx2JpLY4abF6NM1of1CqSOzjAAR/40lMa9J3d5aR7WVTrGzIVVw4JyQlU++Wuzs LjKJVCE5aqe8b+4QlUDRqTciOLAMiTQ3roJlczthj4ViT7Uw4T8kTyISC8MF3ulSJAQk cvidusMw9ptcjtK0rOjaxjToaSEdXBAP7yP6ykstd2reCFK0Ya+mA/x/2Z7aBrYpP/pO JcPA== 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=G0ifE83LtMRyfgkZHIOBSNcl6mKPbZ43dLi8uqtEacY=; b=H5JbT+7z22MfiNv34zXmZWXRsPJsr1dk8yWK8PxEqEpraxvdfGi2BepaYqQtSi78Io rsXTo1xCGinpurrKldIE2sczd6ybpWbAzkNrLXCHn5pDcAW/u++sT1Tu5ULNUlqc+qh6 2BoLGNdyKbUfUlQPCdGLJlYHASkQAJxuu9k3/Nxu7l6tdiZGQH0d8vJ6rvLDZsFdu4EY 5C+DulBu0AJgluU1OcEk+o9AlvNp4vq9yIjOHOfSfxER4fUFoqIaMNG/MzvbTuRFNu+9 ZUMCCEgzGrngVfu6vgbPY5cKSTZGEuQR539CUluR7He8asAUXpZfYY2cKAajRx+ht4V7 mjiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xNiXFJYn; 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 x11-20020a05620a258b00b007468bf8360asi6828605qko.219.2023.04.23.22.53.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2023 22:53:29 -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=xNiXFJYn; 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 1pqp4g-0006AB-6F; Mon, 24 Apr 2023 01:49:18 -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 1pqp0b-0006F9-4U for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:45:19 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqp0H-0005MR-Sd for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:45:03 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3010889c6ebso2304117f8f.2 for ; Sun, 23 Apr 2023 22:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682315079; x=1684907079; 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=G0ifE83LtMRyfgkZHIOBSNcl6mKPbZ43dLi8uqtEacY=; b=xNiXFJYn0HJXP2hnvh5iITRlVIwJDWg5sByVmkRkQ6k5XZk2DoKVg/fdJ0stKNIbxM YrEa/Dr3dWjGc5F+lfry2bFMLN78AmoBapDccKZqluR0Z2qF+bGtNg1oG7kUwxuxgSYr r+Uz/YPkwQweyeqJ3+qa9UJWjkOe5fxyKvPzYcs1fXSrq7VRQOxY4zS7Fn8xiq4xO0g0 240VtylU9+nS2quLh4L6w/6296AjlhtXO0VbX496Yv3MkKQSbPUqxdLjFBb/1kty0lI1 Ob2CLixYy3PZpT7i7aSDzi95BcHzOwDtWaBx/lUTg8yGb5toFS9GfbFZIVDptDjBvvlx mmiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682315079; x=1684907079; 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=G0ifE83LtMRyfgkZHIOBSNcl6mKPbZ43dLi8uqtEacY=; b=MhyihZIh7PQqxGqZ2+CQdhT+SYp00Q5l+DFSpqKV6CejdrxDPX1uoBn3CXJDpY0msv ZHUUqrhSDWX87NqSxa9az98XKj2XxPfG/wLxUpP1F4K7F1pgSqapPcoBvsaM2yxC1LT2 CTnn6d5W7Z7Ml2/mrP2QplDoiZV12HZfOi7Qdvhd3Dvb0FD23yIKkiqyfnzdrp+OKUsy +9V3MDh6zs69T3oK7Tezajwh9SYoOu27gtY2HipT8rokVSgEGztnab9LYlHzEm/7cC4v 2i1VDrV0zaQodFb91/7kLVHvLI9GCFGfDlj99XC0PgghsJCPO8kAH+jKomKR5BZsAAl2 7DUQ== X-Gm-Message-State: AAQBX9dO5Y8K4Igpl69cNXxUOaa68/hmye3n1W0SuuGiqpJZoj4LMZ0J 7xw2fcEeHtIU5yTl+y3LKGIuL4T5SRvXZVDYJE/4gw== X-Received: by 2002:adf:ff83:0:b0:2f9:5841:a4d4 with SMTP id j3-20020adfff83000000b002f95841a4d4mr8233932wrr.27.1682315078851; Sun, 23 Apr 2023 22:44:38 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 22:44:38 -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, Daniel Henrique Barboza Subject: [PATCH v3 55/57] tcg/riscv: Simplify constraints on qemu_ld/st Date: Mon, 24 Apr 2023 06:41:03 +0100 Message-Id: <20230424054105.1579315-56-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::435; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x435.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 The softmmu tlb uses TCG_REG_TMP[0-2], not any of the normally available registers. Now that we handle overlap betwen inputs and helper arguments, we can allow any allocatable reg. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target-con-set.h | 2 -- tcg/riscv/tcg-target-con-str.h | 1 - tcg/riscv/tcg-target.c.inc | 16 +++------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/tcg/riscv/tcg-target-con-set.h b/tcg/riscv/tcg-target-con-set.h index c11710d117..1a8b8e9f2b 100644 --- a/tcg/riscv/tcg-target-con-set.h +++ b/tcg/riscv/tcg-target-con-set.h @@ -10,11 +10,9 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I1(r) -C_O0_I2(LZ, L) C_O0_I2(rZ, r) C_O0_I2(rZ, rZ) C_O0_I4(rZ, rZ, rZ, rZ) -C_O1_I1(r, L) C_O1_I1(r, r) C_O1_I2(r, r, ri) C_O1_I2(r, r, rI) diff --git a/tcg/riscv/tcg-target-con-str.h b/tcg/riscv/tcg-target-con-str.h index 8d8afaee53..6f1cfb976c 100644 --- a/tcg/riscv/tcg-target-con-str.h +++ b/tcg/riscv/tcg-target-con-str.h @@ -9,7 +9,6 @@ * REGS(letter, register_mask) */ REGS('r', ALL_GENERAL_REGS) -REGS('L', ALL_GENERAL_REGS & ~SOFTMMU_RESERVE_REGS) /* * Define constraint letters for constants: diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 4c8e38599b..d5239418dd 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -125,17 +125,7 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) #define TCG_CT_CONST_N12 0x400 #define TCG_CT_CONST_M12 0x800 -#define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) -/* - * For softmmu, we need to avoid conflicts with the first 5 - * argument registers to call the helper. Some of these are - * also used for the tlb lookup. - */ -#ifdef CONFIG_SOFTMMU -#define SOFTMMU_RESERVE_REGS MAKE_64BIT_MASK(TCG_REG_A0, 5) -#else -#define SOFTMMU_RESERVE_REGS 0 -#endif +#define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) #define sextreg sextract64 @@ -1626,10 +1616,10 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_ld_i64: - return C_O1_I1(r, L); + return C_O1_I1(r, r); case INDEX_op_qemu_st_i32: case INDEX_op_qemu_st_i64: - return C_O0_I2(LZ, L); + return C_O0_I2(rZ, r); default: g_assert_not_reached();