From nobody Thu Nov 14 07:14:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1611951964; cv=none; d=zohomail.com; s=zohoarc; b=bknip1Dxv0aLCIe04HfPgh+JSl1NMCvNKTL0eiYFRyZJWI9mTdgMfyJGKZ09h0LTY5DF/84eP8oFzRcBjDmLPQDQcMBNqrYqcQsmTo2TU5A8vWJL20roMVIngyVIkX9YDNRCeCuSQuqz4NBoozKql4Oa1VuMm18C+7Z7mF+3zE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611951964; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VUVejRK81rsj4L29tUqUpPwwe85/JVUx2UgkVy5ibcg=; b=eczjbiParcv4NAlPMTKp9+IEj0HZN4aqXYRB848b5eQvemQOn45ko7l9lgtuL0Ed4YqBN628hBB6yglzNutx8wbpSmuUwQZkCYKI+zLqdotDynCov3h83AXSwtMTn+6Pbb/zCV78IHXu5lEXZVFNK9Ok+D+YKA9rxukaT3pAuNw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611951964532834.6174487654089; Fri, 29 Jan 2021 12:26:04 -0800 (PST) Received: from localhost ([::1]:51046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5aLD-0007RA-Bj for importer@patchew.org; Fri, 29 Jan 2021 15:26:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5a6j-0006uI-VA for qemu-devel@nongnu.org; Fri, 29 Jan 2021 15:11:05 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:37163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5a6g-0008AK-ET for qemu-devel@nongnu.org; Fri, 29 Jan 2021 15:11:05 -0500 Received: by mail-pf1-x436.google.com with SMTP id b145so127757pfb.4 for ; Fri, 29 Jan 2021 12:11:01 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id d133sm9247265pfd.6.2021.01.29.12.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 12:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VUVejRK81rsj4L29tUqUpPwwe85/JVUx2UgkVy5ibcg=; b=A6Ji0F4GyrRi9PjKAoCUQkQPutGO9PvMHiIJaW2y8mvAJv3mgLEN9W1e3sJss8eS8e KDDvpII4TL4v0MeDSAfuhwEd90XKMfjGxeib+kvvg5tnpw3PHxHEZcFdI7c7FMzlyZ3D KwBwnHM8a7drHOLp+8jiAf4rHLUebf0Nnn/JvfeB5wdlN85kuEFOOPPUzdQjj2xzyCbi eimrYUEmm6Vti3t6Paup2OSNGRfLB9krcfcp45y8gtBDaz5M38WIYPw1c51m/Fv+AQXY G0sK9I90vv5i6b6HRafe3y8SVXY8NYRjilw6hBj+ptnrcLDNLEHvNWLF12Q6F41vIjC5 /nIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VUVejRK81rsj4L29tUqUpPwwe85/JVUx2UgkVy5ibcg=; b=SBUflzGDMBED6tnBOY8AVDxGnD9++zdbw0zMFlZrIB29A2gq09yX3a/k+dCwO9sY8m 98bCm4JHAlnfg6Bi8wHTKKS++SbocM9Km5B0KrJ2Uae9lXcje4n2DuHGWC4Gi6sER/ui 4AMeCFQRQ1KL1LMKe/WbymUCtTIL8zOTPCyZaynb1OQ6OsmlqXhRLcS5ZlGzm9PDHGOw VoUlHrSovSCypu61j64K0wM7a/ng2ULAqMURKfMgWaUznUirEoQVF3mB46+3Kfkwv/HP Ex3eGg6xIIr19RGrCNQBBxqOmELdiKvh8nXIFXdkSCzFmHm7SqEgNnusKJZ/LgPzPhGT IcuQ== X-Gm-Message-State: AOAM531xlPzAXbfc/8NJe8GV8QB1uJ1H/WJZ0FwH1VbO+Q/BNcmK8QZ5 OkkMn5unoWwmWUPPECrNRCdlx/v+DATXF0Ee X-Google-Smtp-Source: ABdhPJw6xPogIbcsrI5VxeGt8m3QTsqInOadTrmaGyDPjs9UYtHcgv38zA7ryUkp2eK3MLtQszSwew== X-Received: by 2002:a63:f20e:: with SMTP id v14mr6386647pgh.436.1611951061022; Fri, 29 Jan 2021 12:11:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 18/24] tcg/mips: Split out constraint sets to tcg-target-con-set.h Date: Fri, 29 Jan 2021 10:10:22 -1000 Message-Id: <20210129201028.787853-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129201028.787853-1-richard.henderson@linaro.org> References: <20210129201028.787853-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/mips/tcg-target-con-set.h | 36 +++++++++++++ tcg/mips/tcg-target.h | 1 + tcg/mips/tcg-target.c.inc | 96 +++++++++++------------------------ 3 files changed, 66 insertions(+), 67 deletions(-) create mode 100644 tcg/mips/tcg-target-con-set.h diff --git a/tcg/mips/tcg-target-con-set.h b/tcg/mips/tcg-target-con-set.h new file mode 100644 index 0000000000..fe3e868a2f --- /dev/null +++ b/tcg/mips/tcg-target-con-set.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define MIPS target-specific constraint sets. + * Copyright (c) 2021 Linaro + */ + +/* + * C_On_Im(...) defines a constraint set with outputs and inputs. + * Each operand should be a sequence of constraint letters as defined by + * tcg-target-con-str.h; the constraint combination is inclusive or. + */ +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_I4(rZ, rZ, rZ, rZ) +C_O0_I4(SZ, SZ, S, S) +C_O1_I1(r, L) +C_O1_I1(r, r) +C_O1_I2(r, 0, rZ) +C_O1_I2(r, L, L) +C_O1_I2(r, r, ri) +C_O1_I2(r, r, rI) +C_O1_I2(r, r, rIK) +C_O1_I2(r, r, rJ) +C_O1_I2(r, r, rWZ) +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_I2(r, r, r, r) +C_O2_I4(r, r, rZ, rZ, rN, rN) diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index c2c32fb38f..e520a9d6e3 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -207,5 +207,6 @@ void tb_target_set_jmp_target(uintptr_t, uintptr_t, uin= tptr_t, uintptr_t); #ifdef CONFIG_SOFTMMU #define TCG_TARGET_NEED_LDST_LABELS #endif +#define TCG_TARGET_CON_SET_H =20 #endif diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 432d38a010..ab55f3109b 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2112,52 +2112,11 @@ static inline void tcg_out_op(TCGContext *s, TCGOpc= ode opc, } } =20 -static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) { - static const TCGTargetOpDef r =3D { .args_ct_str =3D { "r" } }; - static const TCGTargetOpDef r_r =3D { .args_ct_str =3D { "r", "r" } }; - static const TCGTargetOpDef r_L =3D { .args_ct_str =3D { "r", "L" } }; - static const TCGTargetOpDef rZ_r =3D { .args_ct_str =3D { "rZ", "r" } = }; - static const TCGTargetOpDef SZ_S =3D { .args_ct_str =3D { "SZ", "S" } = }; - static const TCGTargetOpDef rZ_rZ =3D { .args_ct_str =3D { "rZ", "rZ" = } }; - static const TCGTargetOpDef r_r_L =3D { .args_ct_str =3D { "r", "r", "= L" } }; - static const TCGTargetOpDef r_L_L =3D { .args_ct_str =3D { "r", "L", "= L" } }; - static const TCGTargetOpDef r_r_ri =3D { .args_ct_str =3D { "r", "r", = "ri" } }; - static const TCGTargetOpDef r_r_rI =3D { .args_ct_str =3D { "r", "r", = "rI" } }; - static const TCGTargetOpDef r_r_rJ =3D { .args_ct_str =3D { "r", "r", = "rJ" } }; - static const TCGTargetOpDef SZ_S_S =3D { .args_ct_str =3D { "SZ", "S",= "S" } }; - static const TCGTargetOpDef SZ_SZ_S - =3D { .args_ct_str =3D { "SZ", "SZ", "S" } }; - static const TCGTargetOpDef SZ_SZ_S_S - =3D { .args_ct_str =3D { "SZ", "SZ", "S", "S" } }; - static const TCGTargetOpDef r_rZ_rN - =3D { .args_ct_str =3D { "r", "rZ", "rN" } }; - static const TCGTargetOpDef r_rZ_rZ - =3D { .args_ct_str =3D { "r", "rZ", "rZ" } }; - static const TCGTargetOpDef r_r_rIK - =3D { .args_ct_str =3D { "r", "r", "rIK" } }; - static const TCGTargetOpDef r_r_rWZ - =3D { .args_ct_str =3D { "r", "r", "rWZ" } }; - static const TCGTargetOpDef r_r_r_r - =3D { .args_ct_str =3D { "r", "r", "r", "r" } }; - static const TCGTargetOpDef r_r_L_L - =3D { .args_ct_str =3D { "r", "r", "L", "L" } }; - static const TCGTargetOpDef dep - =3D { .args_ct_str =3D { "r", "0", "rZ" } }; - static const TCGTargetOpDef movc - =3D { .args_ct_str =3D { "r", "rZ", "rZ", "rZ", "0" } }; - static const TCGTargetOpDef movc_r6 - =3D { .args_ct_str =3D { "r", "rZ", "rZ", "rZ", "rZ" } }; - static const TCGTargetOpDef add2 - =3D { .args_ct_str =3D { "r", "r", "rZ", "rZ", "rN", "rN" } }; - static const TCGTargetOpDef br2 - =3D { .args_ct_str =3D { "rZ", "rZ", "rZ", "rZ" } }; - static const TCGTargetOpDef setc2 - =3D { .args_ct_str =3D { "r", "rZ", "rZ", "rZ", "rZ" } }; - switch (op) { case INDEX_op_goto_ptr: - return &r; + return C_O0_I1(r); =20 case INDEX_op_ld8u_i32: case INDEX_op_ld8s_i32: @@ -2190,7 +2149,7 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpc= ode op) case INDEX_op_extrl_i64_i32: case INDEX_op_extrh_i64_i32: case INDEX_op_extract_i64: - return &r_r; + return C_O1_I1(r, r); =20 case INDEX_op_st8_i32: case INDEX_op_st16_i32: @@ -2199,14 +2158,14 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGO= pcode op) case INDEX_op_st16_i64: case INDEX_op_st32_i64: case INDEX_op_st_i64: - return &rZ_r; + return C_O0_I2(rZ, r); =20 case INDEX_op_add_i32: case INDEX_op_add_i64: - return &r_r_rJ; + return C_O1_I2(r, r, rJ); case INDEX_op_sub_i32: case INDEX_op_sub_i64: - return &r_rZ_rN; + return C_O1_I2(r, rZ, rN); case INDEX_op_mul_i32: case INDEX_op_mulsh_i32: case INDEX_op_muluh_i32: @@ -2225,20 +2184,20 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGO= pcode op) case INDEX_op_remu_i64: case INDEX_op_nor_i64: case INDEX_op_setcond_i64: - return &r_rZ_rZ; + return C_O1_I2(r, rZ, rZ); case INDEX_op_muls2_i32: case INDEX_op_mulu2_i32: case INDEX_op_muls2_i64: case INDEX_op_mulu2_i64: - return &r_r_r_r; + return C_O2_I2(r, r, r, r); case INDEX_op_and_i32: case INDEX_op_and_i64: - return &r_r_rIK; + return C_O1_I2(r, r, rIK); case INDEX_op_or_i32: case INDEX_op_xor_i32: case INDEX_op_or_i64: case INDEX_op_xor_i64: - return &r_r_rI; + return C_O1_I2(r, r, rI); case INDEX_op_shl_i32: case INDEX_op_shr_i32: case INDEX_op_sar_i32: @@ -2249,44 +2208,47 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGO= pcode op) case INDEX_op_sar_i64: case INDEX_op_rotr_i64: case INDEX_op_rotl_i64: - return &r_r_ri; + return C_O1_I2(r, r, ri); case INDEX_op_clz_i32: case INDEX_op_clz_i64: - return &r_r_rWZ; + return C_O1_I2(r, r, rWZ); =20 case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - return &dep; + return C_O1_I2(r, 0, rZ); case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return &rZ_rZ; + return C_O0_I2(rZ, rZ); case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: - return use_mips32r6_instructions ? &movc_r6 : &movc; - + return (use_mips32r6_instructions + ? C_O1_I4(r, rZ, rZ, rZ, rZ) + : C_O1_I4(r, rZ, rZ, rZ, 0)); case INDEX_op_add2_i32: case INDEX_op_sub2_i32: - return &add2; + return C_O2_I4(r, r, rZ, rZ, rN, rN); case INDEX_op_setcond2_i32: - return &setc2; + return C_O1_I4(r, rZ, rZ, rZ, rZ); case INDEX_op_brcond2_i32: - return &br2; + return C_O0_I4(rZ, rZ, rZ, rZ); =20 case INDEX_op_qemu_ld_i32: return (TCG_TARGET_REG_BITS =3D=3D 64 || TARGET_LONG_BITS =3D=3D 32 - ? &r_L : &r_L_L); + ? C_O1_I1(r, L) : C_O1_I2(r, L, L)); case INDEX_op_qemu_st_i32: return (TCG_TARGET_REG_BITS =3D=3D 64 || TARGET_LONG_BITS =3D=3D 32 - ? &SZ_S : &SZ_S_S); + ? C_O0_I2(SZ, S) : C_O0_I3(SZ, S, S)); case INDEX_op_qemu_ld_i64: - return (TCG_TARGET_REG_BITS =3D=3D 64 ? &r_L - : TARGET_LONG_BITS =3D=3D 32 ? &r_r_L : &r_r_L_L); + return (TCG_TARGET_REG_BITS =3D=3D 64 ? C_O1_I1(r, L) + : TARGET_LONG_BITS =3D=3D 32 ? C_O2_I1(r, r, L) + : C_O2_I2(r, r, L, L)); case INDEX_op_qemu_st_i64: - return (TCG_TARGET_REG_BITS =3D=3D 64 ? &SZ_S - : TARGET_LONG_BITS =3D=3D 32 ? &SZ_SZ_S : &SZ_SZ_S_S); + return (TCG_TARGET_REG_BITS =3D=3D 64 ? C_O0_I2(SZ, S) + : TARGET_LONG_BITS =3D=3D 32 ? C_O0_I3(SZ, SZ, S) + : C_O0_I4(SZ, SZ, S, S)); =20 default: - return NULL; + g_assert_not_reached(); } } =20 --=20 2.25.1