From patchwork Sat May 6 07:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 679587 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp745568wrs; Sat, 6 May 2023 00:28:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6GQZRURzHSzHQesE55pq8LsoTKFoFTnqI5tMMOXZRNfKaDvQifK1t1USD3nNWg/o0kYXmL X-Received: by 2002:ac8:5f89:0:b0:3ef:46b0:80db with SMTP id j9-20020ac85f89000000b003ef46b080dbmr5746067qta.11.1683358116250; Sat, 06 May 2023 00:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683358116; cv=none; d=google.com; s=arc-20160816; b=rKlKKt+vnCbwVOGmt5y+Om+gw7KpBbEUZb7JeAhXYKtr+wRiyw/2bThUG1yj+O3535 dUrYMx+JK5gVxFWmWusY8Q9zJfYGeA4xixbN6/T2TdVPF+UfkpEzvE9cRkuf0+5vrw0G B7GrHjFovFJDIncML5AKYQSRu4LPftNProWB0BDnBoyOFdRULQqtso6g9T7qjxIsCmsl 9KDYgEE5O5axeslqp5TlqDHh7ZQIHs8AZoIiaeo4y7WcZlud9TxXoml0YVmku8sAcdzo +V3TddpWOGPfFmoWMvngES5u1PtG+4jFu3T2x6+YsRIHId+7BK4qDoSBBng1FEuQRgrv z3JA== 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=4FwbXCfJhxIqyab8rUpzADm0cxrqrrSpiPKuK+rasgY=; b=EGiMwJBNOmsK2ZdldzHn5jp9xkq1i2T5SDNpiibg5UQwWn95ULRKAd3UY1DvK++lDm x5P755BJPHloJASoI83UX/KdL58Q3Mvi4s6JLTnN52y8RLIx5v/2LXn3ooyrzcNAwvYm 3kyU4Qn+fQwsS3h6EjjWLQaFrT2czSULnZV5m3wrTbh26e6mGZVwuFe49wXa0x251LX4 IrRPw5aWgtltWVRwgwBSZ+d77iwxM8tgjNo+A6HsYuj/ohOxGmHxQq5k5E0nc6tClWTd 1dqHhdlBp14Qn7a43Nqlz2TMOec5g3D+R2SoPwFJ0ijoUY88TdAbsIEeripj6dLycC2G zQQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q4NPOj9/"; 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 h4-20020a05622a170400b003ed4808b5cesi1196113qtk.687.2023.05.06.00.28.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 May 2023 00:28: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="q4NPOj9/"; 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 1pvCGZ-0005sk-8k; Sat, 06 May 2023 03:23:39 -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 1pvCGW-0005gO-8t for qemu-devel@nongnu.org; Sat, 06 May 2023 03:23:36 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvCFv-0004Xp-CV for qemu-devel@nongnu.org; Sat, 06 May 2023 03:23:36 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3062c1e7df8so1731556f8f.1 for ; Sat, 06 May 2023 00:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683357778; x=1685949778; 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=4FwbXCfJhxIqyab8rUpzADm0cxrqrrSpiPKuK+rasgY=; b=q4NPOj9/E+zXYe/Zd3aMwxW38WnbsUv/LrnxjyrUyqRetTj8CpVgMTLPp93IC2Jc0Z OKy2/Ct/HVz4Ci56jwggj0kV1ij0MuPSOqlRgTS2Yei0rtwINNDKxjn+D4YUx96jJUTC k7DYbjOvQfJHKng5G6jhsNshWFwIyaB0YokThGDvwSOozkkcG+N9sLguhbAY0qooRjYV +siGncxgkENvCkBcRRZjXkNuRW0NAeduVpVpVUwlCOTxzy4M92QqNjwU5cGdSFuMPWsd y/MiUJbc7s1jk7NZqWpuM2bLI3BNlegW6L5GtLje110xN65kK/cnbvnqZd1zNFbvy0L5 hsNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683357778; x=1685949778; 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=4FwbXCfJhxIqyab8rUpzADm0cxrqrrSpiPKuK+rasgY=; b=SY08MnTUm7ABNHMp1Ad9JgUqYtxPE5Y4p6n0D9Q+h50lZCFZinqzhRqgsdxhPonHzk d7KcAKTEoOc/UwCS6tW70dRDMGbArkxvntLhn3af6nvQJhhNB1r6NXGFSqxV8KheFohF VtDKfjsgn6pwS9v/+GaF7BFF63k/lz0EA4JiIvCzO5JVBY5KXILyT9kH4wXsjkzhrRDv h8gSZVlD3760I67nDJbKoPMo4cuEg/JzcKXUqV8SfTIfXYC836jb47JunepdWdKqX8iW LP2e9OUS6iVIs9/vcQaep2kxo++LimiSLMQ/NxxoYz63ypLxQe97EaT1UQC3S0izm/G7 GWEw== X-Gm-Message-State: AC+VfDx54akLN92hBFqeVOTOhgISN2uToc3HvaoIS1iQDE+gAZl2N1hM KQm7BGVG7XPLJZYyKo7VFqt2GMOemskSH0Tzk1wS9A== X-Received: by 2002:a5d:6801:0:b0:306:2b64:fd1b with SMTP id w1-20020a5d6801000000b003062b64fd1bmr2828134wru.52.1683357778081; Sat, 06 May 2023 00:22:58 -0700 (PDT) Received: from stoup.. ([212.241.182.8]) by smtp.gmail.com with ESMTPSA id x9-20020adfec09000000b002faaa9a1721sm4481223wrn.58.2023.05.06.00.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 00:22:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: git@xen0n.name, gaosong@loongson.cn, philmd@linaro.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, Daniel Henrique Barboza Subject: [PATCH v5 28/30] tcg/riscv: Simplify constraints on qemu_ld/st Date: Sat, 6 May 2023 08:22:33 +0100 Message-Id: <20230506072235.597467-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230506072235.597467-1-richard.henderson@linaro.org> References: <20230506072235.597467-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42c.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 Reviewed-by: Alex Bennée --- 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 d4cff673b0..d88888d3ac 100644 --- a/tcg/riscv/tcg-target-con-set.h +++ b/tcg/riscv/tcg-target-con-set.h @@ -10,10 +10,8 @@ * 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_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 c22d1e35ac..d12b824d8c 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 @@ -1600,10 +1590,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();