From patchwork Sat Apr 8 02:43:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 671479 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp608196wrt; Fri, 7 Apr 2023 19:50:24 -0700 (PDT) X-Google-Smtp-Source: AKy350buwlrt7VvnbOmCclwf8fRB0nX2PnJMHCPJN+OTPOMA4q2KGkPZ8OBaZVu/R1XSFc0K1Cy8 X-Received: by 2002:ac8:5b08:0:b0:3e6:4d8a:12ea with SMTP id m8-20020ac85b08000000b003e64d8a12eamr959896qtw.47.1680922224341; Fri, 07 Apr 2023 19:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680922224; cv=none; d=google.com; s=arc-20160816; b=OyFf6gewIqqzzdKiVmGvSZu+bkGX+hMQ7cRlNI9Q2/YMpjQJhJQruRvOwdLK9gdXc0 rwYMWxjG2roJQBB+CQYzFDCnMSDRml5h7DkS5ZENByH/ZlDVcoW10VpWubuaPszwXWGO 15EKCTjdJZefBj8V5qUKBu2wvspS5mjm1xp/QaFVoiB4w1SyWMdJyYmx4rxp/Xq88qtQ 445R6ddLltkSzEhUsDHT596LoTmfvGBnVsSqZM0k4wINWlZOt3ETIBHaofYtYUJDYwvp tWfmRJp/k+Q9UBDIal4a3D9dwpK9n7DQVwI4xEqF3tBS54J+jWeopf9S15WZL86H8Lcy dNrg== 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=u3QvbuMmLJFN66+AgerJ4hDVUqG975uEhSCFouk7XB4=; b=u0d4Fg3zH0IoMf7v0MteRQ0UjbwTMVaZvYB0guRJHhyZbMpHk3ZtcpQT21SfOtiPoL 3n+3qb7Nc85ZD4nmqMYUZdwx5AZ/+7b+/9FlyegWfCpw0DoXLZlgJSesqaLxjhrHihJQ JtKiMnBhy2l5zXz2vRpoLvh0u81q/Sstw8k4j6kwXelKI8v94KDum8LHAgq9uRDf3HLO 6TEw4fKYBwCMoCFwafvzrVe4q0vj8xPPShhQs8BvW3xYm9x6cqk/nsJAbC6kFghcwIz6 YM/egDEg8LKaE42vj70rjdTzTrfulsx+Ow7vxnD8FLq4yu5lONdsa1lyYhg8WoRDrUbA TrSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZdSWsa6E; 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 t10-20020a05622a01ca00b003bfe796bfb9si3809027qtw.319.2023.04.07.19.50.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Apr 2023 19:50:24 -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=ZdSWsa6E; 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 1pkyZT-0001Zf-7W; Fri, 07 Apr 2023 22:44:55 -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 1pkyZB-0000BT-Or for qemu-devel@nongnu.org; Fri, 07 Apr 2023 22:44:44 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkyYb-0005ft-GC for qemu-devel@nongnu.org; Fri, 07 Apr 2023 22:44:37 -0400 Received: by mail-pj1-x1029.google.com with SMTP id v9so5046771pjk.0 for ; Fri, 07 Apr 2023 19:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680921830; 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=u3QvbuMmLJFN66+AgerJ4hDVUqG975uEhSCFouk7XB4=; b=ZdSWsa6ERlfHiTwam0IQTYjTL62Eq74YZIMXCeXBvP/ME89ZlRUlqB5ZFbNJbov+ZE Q+1LDauE8R/aoEm/zXUFr5e1Fxq62FVH+RSJo/Zkmy85AyNU+Xv5midE3bZJLqlOLPsX R5qwJ9id6YPcJpTvGNNV/6oda6uPWUuKBFE6Kd+rUIowu6FTFMLUavvHTcUa3qbU/J/c pvXg5PV/0VGP/fUSbAjM273gK+FaKTrqBCjxe+Ghqes88VS5CV6YNWO+2AnonpPbm069 JABdgPdYNXOCSRjcsF0ArTCnDxYIAAqcgp0irOu4jdPTmXWuOmQGUkyz+2WcN1/vAd/3 /4Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680921830; 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=u3QvbuMmLJFN66+AgerJ4hDVUqG975uEhSCFouk7XB4=; b=qx0AAKd2+ZdhM5fkJraMdZGDZ77Ku2iShZ5DFLxVTny45Kt1BFjQW2SWkE5CDPAvtk wJWmxR2n1x6b8IpjUuODqMl6VFhSW+Zk7yJ97/iA9rJuxAcetJunewvDnOfsSUHz+kL4 CrYyFhC7AkQVQDIV1RNQTq0q9JmvASQDox0eDHacl7srthm4O6xKngk9GyKDYRQnC8Jk fRDg5+nLKxZi9qPtljre/d6Po4m9UGoV82xBfSX25a8HWymwGhDW6NYtBZiBcIwAif/D qCRKGmr5HCUlavgaAwsjYzb4ImL6uQDLcV1t3sQzN7yqTwsZNjE5vb+PjLvjV6ZdJgdW /xMw== X-Gm-Message-State: AAQBX9edZQSNIPgLqwH7lGHqxxKNLeE3pur8+0Ce/Wj7r0QEY3YONnKo WwSF6yqm4xuQfJr0vTQnJ7k9ZNybD42IWjEEItE= X-Received: by 2002:a17:902:ec83:b0:1a1:dd05:39fe with SMTP id x3-20020a170902ec8300b001a1dd0539femr823556plg.4.1680921830263; Fri, 07 Apr 2023 19:43:50 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id d9-20020a170902c18900b0019d397b0f18sm3530780pld.214.2023.04.07.19.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 19:43:49 -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 38/42] tcg/riscv: Simplify constraints on qemu_ld/st Date: Fri, 7 Apr 2023 19:43:10 -0700 Message-Id: <20230408024314.3357414-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408024314.3357414-1-richard.henderson@linaro.org> References: <20230408024314.3357414-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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/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 ab70aa71a8..45a4bc3714 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 @@ -1654,10 +1644,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();