From patchwork Sat Apr 8 02:43:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 671465 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp607488wrt; Fri, 7 Apr 2023 19:47:20 -0700 (PDT) X-Google-Smtp-Source: AKy350Yxh9q8AfAEPjjR0zfqMO9Pxp92ha8MAM8ADrGzzX3vwLKdRnUWM06J81yQVUg7gIIgBYRr X-Received: by 2002:a05:6214:19e8:b0:56c:13cc:d21f with SMTP id q8-20020a05621419e800b0056c13ccd21fmr7796786qvc.50.1680922040636; Fri, 07 Apr 2023 19:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680922040; cv=none; d=google.com; s=arc-20160816; b=FwUoJXpLwTHAXxAH5BDqwF41xvR4MinlQL/QaRR6SX8NAihQcjQbuPQIgNbbnXC/UJ lKb0IZAXJZHTPPZ+1lt3VThyn23hrqYHYjtskN1xXaJ9spRkEnMCa4bu2pRamJ8EgfQf fDPrEXuG4umKjI8f/ranVrSprxfkIQ8zMQZlE2lJkjiZ9nETVev4s+wnEB3XpagDpNCz g9ojfksUpZhKDJyz9xsXbgE+2FeefzBy8aIhY5oGp5fsV6L2uflOt3joUuB6g2wN0tHF au1r4+4K5MPoIvAH+CtlHiilSbQ3mHaBMMgpOaPVD3vyOiw66FQC3rGyOTsYcjpKJhrG DjtQ== 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=ZD8D6s1mTsZ3Wn5qEWwRrv84r6pcuNTBrq2RsXDvc+c=; b=fLgdUg+qYn+EWtf0Wf7B95Q+e+GhK6DUezAj4XRcnJI+VReiAUw7ubr0roHHAvc33b nX/Ju0ESaRkKnePKG/skpeO4Azahpa+2fPptoYdrBoY1ZwNaLoBKgBm7M84iCfxy84sc VC/U7tuslGEW7P7b7LQps5AMdt8PlLmZfZYAsMWD+DemoUUUDt7t7EZwnk2LH3hJ6Gy1 SwYmk/tn6ifQpck+sHlUlNzFyKO4sZQXAe9Uoe59UJ8F5Bfp/pKSczo5pQtq5zWgZvrn sRwQBWXBxM5M+2BUNM75dneX3/Bc0jmUaAXfWm6G0dY0NaJUpRtJQr0hXpbhsMINClbx Beqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W/91gids"; 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 bs19-20020a05620a471300b00706ab5a015bsi3935603qkb.344.2023.04.07.19.47.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Apr 2023 19:47:20 -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="W/91gids"; 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 1pkyZP-00014T-II; Fri, 07 Apr 2023 22:44:51 -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 1pkyZ3-0008S8-CT for qemu-devel@nongnu.org; Fri, 07 Apr 2023 22:44:31 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkyYO-0005rM-IN for qemu-devel@nongnu.org; Fri, 07 Apr 2023 22:44:29 -0400 Received: by mail-pj1-x102f.google.com with SMTP id q15-20020a17090a2dcf00b0023efab0e3bfso2789055pjm.3 for ; Fri, 07 Apr 2023 19:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680921826; 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=ZD8D6s1mTsZ3Wn5qEWwRrv84r6pcuNTBrq2RsXDvc+c=; b=W/91gidsjvoXEE+rAUGpm233QgUDJr99+R+jskgo5ZQc93gfApAewQRXLZK6LDTdYk qpDE5rxsVYuutImUDTZRYZ/o7gK0OEPFp+/435LDZ41sArWVpEu1zPFaJZPnbVFTFYFT DvWTgZYAgOzT2BgU99KSbI9pxil002qQ2AyZL9UnGgmweR3O2jnYx93g6KtNVadY7rNi EFLhbqWwWlZ2DLsrz+VgEHjKpl/J3jGG/J+dE75S8EZoiyYX0oSYRbJF6zftRneVkwnN hGSlHckhALxBhBpNxdutE0jfpw6NOCMcHAQXx/0GQ951cqG5ZJPrltXFkj5URMcXUpys +Ozw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680921827; 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=ZD8D6s1mTsZ3Wn5qEWwRrv84r6pcuNTBrq2RsXDvc+c=; b=WMlyek5g4mMqm8M7u/vVV6Ot1/J6hiNDaomkTPf1+QWgoOVe7mTYc2IluIp8jkWyrR UO19gtdhAn/I7tz0dgG4che9IebxjlAcjoqKMe8kWcHk/qGjb4fa/qhWvtPFcWeuDRXd 1E2HWelhu1CPE4LkIejlqBUhSOjSoHX4/z+23gKVT5whJguuBzzytRO8FuPXA6DeKHIA uZxOOnEGXxQawLB0ku0yZ1J+Y9P7qkLTxuq/0JId3ifVhUaypMb9tM3iuwWEakuP/9IE Mm2NtFPTKXlsP2UD1t29W0eqpYsZtv59epcOqmE9IggswX+puFY1BImBegzzOOw7tTei aPJw== X-Gm-Message-State: AAQBX9fOR/D9VNa2tHnmC4gU7ZciRV6eBN8lLw4Fg7WAq0RzSgUKzrUt uEMtJV39bqQo2TNdx6G0XlhpW8Jusn5OXt8mtjs= X-Received: by 2002:a17:903:2281:b0:1a1:b15a:d916 with SMTP id b1-20020a170903228100b001a1b15ad916mr6006834plh.3.1680921826681; Fri, 07 Apr 2023 19:43:46 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 19:43:46 -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 34/42] tcg/mips: Simplify constraints on qemu_ld/st Date: Fri, 7 Apr 2023 19:43:06 -0700 Message-Id: <20230408024314.3357414-36-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::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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-3], 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/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 16b9d09959..34908c799a 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) { @@ -2488,18 +2474,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();