From patchwork Tue Apr 11 01:05: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: 672329 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp539180wrx; Mon, 10 Apr 2023 18:18:09 -0700 (PDT) X-Google-Smtp-Source: AKy350YGiPv6fL0FdCIlFiZLbHV7l6Z0UWJB7O4YYqJMMx4pM1Mmvdo8yYp4PQEg3olETHpZz6lx X-Received: by 2002:ac8:5c8b:0:b0:3e4:df68:a5a4 with SMTP id r11-20020ac85c8b000000b003e4df68a5a4mr22270723qta.33.1681175889166; Mon, 10 Apr 2023 18:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681175889; cv=none; d=google.com; s=arc-20160816; b=mW3CXV49xOCdr5+SulZp1N+qtNh9Cybfo1dFpg1SyTsHjrjgUlYzYksWoGnDChtOE5 HMIv8fgptFqZvKi72/a9NmH41Pge10hTsdAHoAh6jUP2vrOqoRpKmq+F8bAhqaqFUdLi fIdNG3JyVgioZCbEO1pG0K2cJbYpjKa416dyiKpHt+P9dXVdLmAQLAWNKIOOhafurVK8 1haQP/TaAHlunGRa0E02V+gQhN1XzkcGvx9sAjceulPf5DbsVzUslntB7A1AEvlX4iYx /L/ZlWcoN7GTIGrkFbY6r7tlBokBbqLxcuYgVX2bxuljn5GKCJzabslb0PVD3Ef+0d2G D5ow== 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=LV1DkoNVtzP7I71/XYjV3YLNXsXbI6vgEyZrR2VbPvk=; b=BPudTwZDaoRYMoT2WM3X9+vUoVkVP6cJJ9gq+zoAjGn+VV7m+EStpoXCLhlfXTHD4R uVe7IVR1QWWLuKvpesaX7II9jDakcXn+YKv6jAu3YJBdD3Ba+QjNnSXNbnAUYJFUK97B mKfGDNFCS0XlWLIvU+fMJnnM4nzlEPpY7bF4BvRMrzobvl0Wdzmvmr6hMu7qVoot6NkK 74etYy54CB3In9wQJ7DmSb1ZCKyAwq7WDhjT7eHiOniy19xrUc9qlfBKdALUDUdHO/9O /VLHJPw69JwRTVSq7iT8XX7SFvueBohhxNuQEHZCHRh6zAGZhpnScMlJpvCaaohFtsCY b5YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o+sEFdrx; 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 bm24-20020a05620a199800b0074690827c5dsi8575568qkb.281.2023.04.10.18.18.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Apr 2023 18:18:09 -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=o+sEFdrx; 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 1pm2Wc-0004h4-JC; Mon, 10 Apr 2023 21:10:22 -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 1pm2WX-00042H-NF for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:10:17 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pm2WR-0001wH-5B for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:10:17 -0400 Received: by mail-pj1-x1032.google.com with SMTP id l9-20020a17090a3f0900b0023d32684e7fso293024pjc.1 for ; Mon, 10 Apr 2023 18:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681175410; 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=LV1DkoNVtzP7I71/XYjV3YLNXsXbI6vgEyZrR2VbPvk=; b=o+sEFdrx9cvoUmwOUyrTQlSKVuItfS8u2QW6qTZ5EjmvTRYkY9OVEM5cQ1fv8TE8rp bYsp7YspYRajTYm0IO1EIMoPJIfe/DPP68Gxo/mq+uZKEgaAcBGmyjOSC7CPIRRJUAhB WKHAU0XInCwQrK32wHyv5mWAcRDiG2wK+2poPfLgh/bIWB9Mok7jNoby9JEGjcmr/aEg xb+W452xqskGCG34w9UU94BfzVLJHB3GS/+wx4x1BCgkQHfljmm2LGEJPznLhCHRZnsi xQCBhK5kO2Q/CRyIjsXOYsnpn8m68jjTuFUPohiuUfMtNY/XzBwhAvUMjLP7pBQ3MNYx frmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681175410; 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=LV1DkoNVtzP7I71/XYjV3YLNXsXbI6vgEyZrR2VbPvk=; b=BuvppbVEo/cqs7wn9aGK0Orm0sCxyn0xaqPzABr1Drlf070hCw9cbqSMTUEJi4rIbI dCMFPGuIluW0EdhboYf2T2kbbnCgSKXV7A4EIU6+GIabBYJq5nKrWe2RxwZCLyEkHWN+ mMeO7W4X0yWaQPYZhUoYQOR7h6CX/vAGZcYDiKS74Memr4mKkOZIXKW5p0qbRzhdntXA 6gvtl/dj91qc+E8zdgm/YRlZNUnmBNLXBxiAq4xDH9nBFhYp0w5IH1jONZ9euhUKhjC2 5FkmEb2OCS8YrP01l0DOYgJdbBPYhG3w8fahd4LeqiEw6I3XkzgAZ+S3NHAbJgVaIBMe /8sg== X-Gm-Message-State: AAQBX9cCqdvWpOE6NgSSVsaUTlJR+k6Uv5r4h/oqfm4NtMcQIh1cQe1t ju80RGD5Vxm2thmu7DkFG0oZr2HKFM6u4SaDvdpN6w== X-Received: by 2002:a17:902:ced1:b0:19c:be03:d1ba with SMTP id d17-20020a170902ced100b0019cbe03d1bamr17613994plg.6.1681175409855; Mon, 10 Apr 2023 18:10:09 -0700 (PDT) Received: from stoup.WiFi.IPv4InfoBelow (h146.238.133.40.static.ip.windstream.net. [40.133.238.146]) by smtp.gmail.com with ESMTPSA id p12-20020a1709028a8c00b001a63deeb5e2sm2652130plo.92.2023.04.10.18.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 18:10:09 -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 Subject: [PATCH v2 45/54] tcg/loongarch64: Simplify constraints on qemu_ld/st Date: Mon, 10 Apr 2023 18:05:03 -0700 Message-Id: <20230411010512.5375-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411010512.5375-1-richard.henderson@linaro.org> References: <20230411010512.5375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, SUSPICIOUS_RECIPS=2.51 autolearn=no 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 5ecae7cef0..23a8dbde5f 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) { @@ -1583,16 +1572,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: @@ -1628,11 +1615,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: