From patchwork Thu May 11 08:04:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 680875 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp3267764wrs; Thu, 11 May 2023 01:12:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6WWDf5MqQ5Av14pwBTJFlxKgf82D8xrBLoEC4F/RzGK0j0AMKgshnXCtvPUIGViWrL+3rY X-Received: by 2002:a05:622a:1a83:b0:3f3:95a7:a5ac with SMTP id s3-20020a05622a1a8300b003f395a7a5acmr15624358qtc.51.1683792772127; Thu, 11 May 2023 01:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683792772; cv=none; d=google.com; s=arc-20160816; b=LiYWbELcIBE4oeBnWFDZV6zkvjHhAWU8vEytObUmIeTfx9mViobXg9o6X4Znid8M8B IuFTG71OHpoDraBJu4PdeH5qUT6NTRy8Z193pKBGRdPkpgpWoGXRdV8cZPiub+L05vtc DgMUrEYACFo8Fk9tnn1OX84ItJl5kgpFVBv9wUEW3MzOh/m+4oQcVkTyX7EM/dK5tZ9d PkAqW2wy/QHhIbfm15fDaMbnd0jHGC/yk8O23Cr/9bL4ZOlzkqY/23K5sh5JhlNOwzmE ZiDnwoMwOTMwtvHtmG/uxiLlTFnfhKdHSmXTYzoXGZXdvxVrbM+3NZkWqfT9lzGDHJG1 JWzQ== 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=fl7pdu93dBMkROr4SQBfhDsQ0W729COy3s3bRXX2ht4=; b=aP48yr5yRTy4yEy6uj5mky2Jru8LSJZEOwEFv/F7llnGHPWDp+IdZBpp3gbU8ph5vZ hcsEFIntvfP/a20zDs65uiWKwMzanuVC+ifEvpln5gv2+TT9O3x3O7lbTRVytS7jq4DG jFjh4W8dD/e8u1kxXd8kYY8VtForBN7l0uXwTw9iq2WofROfT5WJXd5puLZ6rmU/kwa/ P39rqIUK/pJqqp08BhjftDww8exbrypQ69AuLCDV2+JXx7Wi78VdN7l3E0t5NpMDdeRM cQ7JqQ7nHadrcp9gU5eB5j6HI5PaHiPaSAgsjaMdK/zKw8ba4QDm/fASog7UiFeyjj8O 1FGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DiuDx754; 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 a6-20020a05620a102600b0074ad554ff02si828578qkk.9.2023.05.11.01.12.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 May 2023 01:12:52 -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=DiuDx754; 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 1px1Ix-0007EP-GO; Thu, 11 May 2023 04:05: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 1px1Ij-0006ZE-Px for qemu-devel@nongnu.org; Thu, 11 May 2023 04:05:26 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1px1IY-00012m-9i for qemu-devel@nongnu.org; Thu, 11 May 2023 04:05:25 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-50bd2d7ba74so76560084a12.1 for ; Thu, 11 May 2023 01:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683792313; x=1686384313; 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=fl7pdu93dBMkROr4SQBfhDsQ0W729COy3s3bRXX2ht4=; b=DiuDx7546usrRNZm7Sire6vREkdJbMFi1zAt8BeXBm+/aDYzMc72UTV1xfH93r9UxH gKJpU3/w5m/bz2TcvQzULkRKP26vpfjhEvNnXPI0a4iokfWi6BySvQGaMmM8mcN7D7Jz eluNiVqOyL3Zdsx4B/0QUT4euCi6I9ESRWyADQg9aXuB89LlGAAB+Emca/6Ds/beYjtQ qNvT8MPLxrQqIcgtdRjyZD2w/CqSAfzatYfc55tLUVVckeFmwuFPYWfwZzzwhBdXK26F rHvnAcuONtu/9dAtxOKShZjf2M6fpwz9sXke3R/tQEG5MyNzTd/bDn0t193rF2/ycO90 Ub0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683792313; x=1686384313; 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=fl7pdu93dBMkROr4SQBfhDsQ0W729COy3s3bRXX2ht4=; b=EB8qRCAu58d0Ur1u0OE614uL3TakVZ2Js1nW5fqevba37gCK6/Klebp+U0pcGTQ5mk TcIuVxb819/qVzNKmaM9G2/iS8xzEvkmIRcHVZQw6duDwMtqjVIeIfrtDV7lYDU1i+Si rzt9opwnB8ME601stiom1y2mO2AM08KmgwNrmjW31PQnD2JwIIXoO966z/kfbwETJoev EdwM71JVOGgaF0LdqD8sAvIXQZSgXkvmtz5+g2oWUO36d5IJDp4U5Kkorf2XBi740zQe th/NIVHmScTzkIMzT8TnxEt1OHQQfNVIKjSnbwjd/pX5xpZn6H6T2ME1qt1tbMhbc6wN wABg== X-Gm-Message-State: AC+VfDz8OVQ71nH0etdwzaONQr7X9ujtqrDpREs5zq4Ryv3Ks7sISKD4 0LJxrBVc1VSDbMmZXqyB1vPChv8gMMLqvdjXVL8NSg== X-Received: by 2002:a05:6402:78d:b0:50c:1677:91ad with SMTP id d13-20020a056402078d00b0050c167791admr18685396edy.17.1683792312931; Thu, 11 May 2023 01:05:12 -0700 (PDT) Received: from stoup.. ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i12-20020aa7c70c000000b0050bd7267a5csm2662095edq.58.2023.05.11.01.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 01:05:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 33/53] tcg/mips: Simplify constraints on qemu_ld/st Date: Thu, 11 May 2023 09:04:30 +0100 Message-Id: <20230511080450.860923-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511080450.860923-1-richard.henderson@linaro.org> References: <20230511080450.860923-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-ed1-x52d.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=ham 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-3], not any of the normally available registers. Now that we handle overlap betwen inputs and helper arguments, and have eliminated use of A0, we can allow any allocatable reg. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/mips/tcg-target-con-set.h | 13 +++++-------- tcg/mips/tcg-target-con-str.h | 2 -- tcg/mips/tcg-target.c.inc | 30 ++++++++---------------------- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/tcg/mips/tcg-target-con-set.h b/tcg/mips/tcg-target-con-set.h index fe3e868a2f..864034f468 100644 --- a/tcg/mips/tcg-target-con-set.h +++ b/tcg/mips/tcg-target-con-set.h @@ -12,15 +12,13 @@ C_O0_I1(r) C_O0_I2(rZ, r) C_O0_I2(rZ, rZ) -C_O0_I2(SZ, S) -C_O0_I3(SZ, S, S) -C_O0_I3(SZ, SZ, S) +C_O0_I3(rZ, r, r) +C_O0_I3(rZ, rZ, r) C_O0_I4(rZ, rZ, rZ, rZ) -C_O0_I4(SZ, SZ, S, S) -C_O1_I1(r, L) +C_O0_I4(rZ, rZ, r, r) C_O1_I1(r, r) C_O1_I2(r, 0, rZ) -C_O1_I2(r, L, L) +C_O1_I2(r, r, r) C_O1_I2(r, r, ri) C_O1_I2(r, r, rI) C_O1_I2(r, r, rIK) @@ -30,7 +28,6 @@ C_O1_I2(r, rZ, rN) C_O1_I2(r, rZ, rZ) C_O1_I4(r, rZ, rZ, rZ, 0) C_O1_I4(r, rZ, rZ, rZ, rZ) -C_O2_I1(r, r, L) -C_O2_I2(r, r, L, L) +C_O2_I1(r, r, r) C_O2_I2(r, r, r, r) C_O2_I4(r, r, rZ, rZ, rN, rN) diff --git a/tcg/mips/tcg-target-con-str.h b/tcg/mips/tcg-target-con-str.h index e4b2965c72..413c280a7a 100644 --- a/tcg/mips/tcg-target-con-str.h +++ b/tcg/mips/tcg-target-con-str.h @@ -9,8 +9,6 @@ * REGS(letter, register_mask) */ REGS('r', ALL_GENERAL_REGS) -REGS('L', ALL_QLOAD_REGS) -REGS('S', ALL_QSTORE_REGS) /* * Define constraint letters for constants: diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 695c137023..5ad9867882 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -176,20 +176,6 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, #define TCG_CT_CONST_WSZ 0x2000 /* word size */ #define ALL_GENERAL_REGS 0xffffffffu -#define NOA0_REGS (ALL_GENERAL_REGS & ~(1 << TCG_REG_A0)) - -#ifdef CONFIG_SOFTMMU -#define ALL_QLOAD_REGS \ - (NOA0_REGS & ~((TCG_TARGET_REG_BITS < TARGET_LONG_BITS) << TCG_REG_A2)) -#define ALL_QSTORE_REGS \ - (NOA0_REGS & ~(TCG_TARGET_REG_BITS < TARGET_LONG_BITS \ - ? (1 << TCG_REG_A2) | (1 << TCG_REG_A3) \ - : (1 << TCG_REG_A1))) -#else -#define ALL_QLOAD_REGS NOA0_REGS -#define ALL_QSTORE_REGS NOA0_REGS -#endif - static bool is_p2m1(tcg_target_long val) { @@ -2232,18 +2218,18 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_qemu_ld_i32: return (TCG_TARGET_REG_BITS == 64 || TARGET_LONG_BITS == 32 - ? C_O1_I1(r, L) : C_O1_I2(r, L, L)); + ? C_O1_I1(r, r) : C_O1_I2(r, r, r)); case INDEX_op_qemu_st_i32: return (TCG_TARGET_REG_BITS == 64 || TARGET_LONG_BITS == 32 - ? C_O0_I2(SZ, S) : C_O0_I3(SZ, S, S)); + ? C_O0_I2(rZ, r) : C_O0_I3(rZ, r, r)); case INDEX_op_qemu_ld_i64: - return (TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, L) - : TARGET_LONG_BITS == 32 ? C_O2_I1(r, r, L) - : C_O2_I2(r, r, L, L)); + return (TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) + : TARGET_LONG_BITS == 32 ? C_O2_I1(r, r, r) + : C_O2_I2(r, r, r, r)); case INDEX_op_qemu_st_i64: - return (TCG_TARGET_REG_BITS == 64 ? C_O0_I2(SZ, S) - : TARGET_LONG_BITS == 32 ? C_O0_I3(SZ, SZ, S) - : C_O0_I4(SZ, SZ, S, S)); + return (TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) + : TARGET_LONG_BITS == 32 ? C_O0_I3(rZ, rZ, r) + : C_O0_I4(rZ, rZ, r, r)); default: g_assert_not_reached();