From patchwork Mon Apr 24 05:40:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 676534 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp1987955wrs; Sun, 23 Apr 2023 22:56:36 -0700 (PDT) X-Google-Smtp-Source: AKy350bnE9Y0I9ZOsN9PeZYc8E3gLLg7s9W1/P3To5rxoulx07NUmoQi1awJrd3/rpTqvzcfWHMH X-Received: by 2002:ad4:5caf:0:b0:5ef:642e:7cd2 with SMTP id q15-20020ad45caf000000b005ef642e7cd2mr20702797qvh.7.1682315796715; Sun, 23 Apr 2023 22:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682315796; cv=none; d=google.com; s=arc-20160816; b=KUU9lA7N2XQVvACWjqV98f9t/PMNmb+hKbSeVJPdurTsFdF6YN0COFvOepcthB58Cv KSKYEHw2LPAoFMsemJmmwr57FcOxnsJ3TPibOFbsYSvLl+h2uIUE8OoyMn3pvUnR69NM nBwaiwR5Nr9EYsU2Hap0BxrHvWn8lRu7T5Q8RyI9lSXxP6uJ4LYw53/btUh4O7Fk+qx+ TuEwmK+i34Dg/uaO7TphpkFnbmlRtJXqYJoPvOWVbkywxrjCqNRjaGs31s3uoQT1i6Av fkpc5el41tI0w6fYOysxBj2Cw2Rnxo7lY1XsJN7rERujhKg5u/aNN4xCCcRaZWeg9zxr vjfw== 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=I/zSZo4J7v0p5c8aMIcv0bwGQ0NvaaNKP+yN/zUi81E=; b=lPg3jFDGmhxQxwIRSwQdNTJ4vxmeRPzQoRmcYbb8+rnN+AEwfvUPTY6V4sURX8AIdW NJJ1fSP4JM4xNxJ07Hu2z964iXYxKa7hbbnhJhZONAXhC/zqY/JD3+lI4vQNUphfGmMg 2RTb9/1sTSRRpfNOeTQR/o6vo0g7Ec3dNhjZ0Sr4kkYwBf6pbzX/ljhQ9lok6NE7TOad swrAM0ey78YdJ+y/XIURuCkHBHBExfqScOUOd3nyT30bjbHx1vh0qT9Etx58p73gb2KK yWcJ6kvErfGGPgveG5yfj76wHN5X7SUXbFqe3Jyjs0HWBSZi5y8Y4qNYVxolu6qFt9/K rxyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aXXTkZMs; 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 s4-20020a37a904000000b0074a4a4e38e1si6285638qke.273.2023.04.23.22.56.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2023 22:56:36 -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=aXXTkZMs; 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 1pqp5A-0007Uq-Qw; Mon, 24 Apr 2023 01:49:49 -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 1pqp0r-0006ZZ-9i for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:45:21 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqp0I-0005JQ-2b for qemu-devel@nongnu.org; Mon, 24 Apr 2023 01:45:20 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f1950f5628so26773365e9.3 for ; Sun, 23 Apr 2023 22:44:35 -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=I/zSZo4J7v0p5c8aMIcv0bwGQ0NvaaNKP+yN/zUi81E=; b=aXXTkZMsBBpm742Z1RSsJqqFEEWUOaCHiteadUsrw+nYbF4G+sWYbu+YTB5KCORFxm psy4w3rmeAcjNza7vc2ivHMRriG3Cd/8+dxVIPVoYnAIDYXUBsSPbqoTRDpbPOUzoe2J iAvLfLreLvtdQansUFHRdSgAJr6KTNZ0CIDrKymy6nZHMx3fvkzGQm6A1Y6g5mUBFywr yps684vRpmbZY2W21Je2C+dT92FHh9U792BtWZmmuUlVV7dTL8nAnbhzP13wieMPyQGh jTzALGiW8KJs9bu7K2SOA9WOv1amIPKZ+qB/8JhUG8dCzRbBCk4vlAPTY03wQ63GjSbU nVlA== 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=I/zSZo4J7v0p5c8aMIcv0bwGQ0NvaaNKP+yN/zUi81E=; b=PUdClWaB2k20LIYdsn8UM29giI3n8ik4ToiK6VTagrkrOawhqpBCIFZjS9PBFFjZd9 clRMH6TTkWVuyIXqkKE1uytcOU5F8dijgLbAFMDtaZWf6Ouu7fnMM7UWo5cXrIKtBRYe R2+XIDk0WDb0HR+d8RkoUwRbunnk5ENkthp3ZWW6ahLaWjetLXo9R1FdA0NbQJlgQkgW MXZvmA9xXCiQG7vEwYkEbrOjnjg6dA/OwARGGdNd6xHzSfL1pLej+6mm4qOHO21w6JDr n3IFEFRupv7wBwWgnFYX1tLEPvjnyzOrhlP0yv9p5GQCJmIFiCJwRaRW5y3FQNl4jP9+ mO2A== X-Gm-Message-State: AAQBX9cx7kGVyunqPCFuQosdYQAv4TAdge3ycGSO7dtmbL47/II1EOiz G+GIjuZ3aIm9vibDefvgfR7Yug52Au0vYeBDkw3A3g== X-Received: by 2002:a05:600c:3783:b0:3f0:a9b1:81e0 with SMTP id o3-20020a05600c378300b003f0a9b181e0mr6822091wmr.19.1682315074448; Sun, 23 Apr 2023 22:44:34 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 22:44:34 -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 48/57] tcg/loongarch64: Simplify constraints on qemu_ld/st Date: Mon, 24 Apr 2023 06:40:56 +0100 Message-Id: <20230424054105.1579315-49-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::32f; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32f.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. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 2 -- tcg/loongarch64/tcg-target-con-str.h | 1 - tcg/loongarch64/tcg-target.c.inc | 23 ++++------------------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target-con-set.h index 172c107289..c2bde44613 100644 --- a/tcg/loongarch64/tcg-target-con-set.h +++ b/tcg/loongarch64/tcg-target-con-set.h @@ -17,9 +17,7 @@ C_O0_I1(r) C_O0_I2(rZ, r) C_O0_I2(rZ, rZ) -C_O0_I2(LZ, L) C_O1_I1(r, r) -C_O1_I1(r, L) C_O1_I2(r, r, rC) C_O1_I2(r, r, ri) C_O1_I2(r, r, rI) diff --git a/tcg/loongarch64/tcg-target-con-str.h b/tcg/loongarch64/tcg-target-con-str.h index 541ff47fa9..6e9ccca3ad 100644 --- a/tcg/loongarch64/tcg-target-con-str.h +++ b/tcg/loongarch64/tcg-target-con-str.h @@ -14,7 +14,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/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 60d2c904dd..83fa45c802 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -133,18 +133,7 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) #define TCG_CT_CONST_C12 0x1000 #define TCG_CT_CONST_WSZ 0x2000 -#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) static inline tcg_target_long sextreg(tcg_target_long val, int pos, int len) { @@ -1541,16 +1530,14 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_st32_i64: case INDEX_op_st_i32: case INDEX_op_st_i64: + case INDEX_op_qemu_st_i32: + case INDEX_op_qemu_st_i64: return C_O0_I2(rZ, r); case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: return C_O0_I2(rZ, rZ); - case INDEX_op_qemu_st_i32: - case INDEX_op_qemu_st_i64: - return C_O0_I2(LZ, L); - case INDEX_op_ext8s_i32: case INDEX_op_ext8s_i64: case INDEX_op_ext8u_i32: @@ -1586,11 +1573,9 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_ld32u_i64: case INDEX_op_ld_i32: case INDEX_op_ld_i64: - return C_O1_I1(r, r); - 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_andc_i32: case INDEX_op_andc_i64: