From nobody Thu Nov 14 07:12:55 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=1611951728; cv=none; d=zohomail.com; s=zohoarc; b=e372APy9E59ZlSQxj+E7m5uA0eiRp6ZlWnmzoujy0ydYEW2m65i4uhyhO0JROt6BZKQ2dx398HIh6JGAAlY77rm4caGJlC1OfDMnCU8vJZMWbRdQs12JuPIUopdZZZBTo9abgAbeSmNAlGBCYXdCLRsDBBdTI4p4FsHRkzInoE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611951728; 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=dgFs0kRvG3YRS9ydc6sjoVZGH6LkBq65P9PIXpXmt7w=; b=WADFLWUe7MLxlQ/P82GLsAkeGJ0486tMBCA2yIYAUtkz9ePV8Bosu+z6FcYkyrRcyIeAd7C+p2PjkC5Ascr4j/7/hLykvOFyZQGgKzqQX/BjgRv2BDpDTnQSEw8N63YYdvWuQwLxJapMfcLgS0IFPJqRVhcpptfYCFgryxiRWv4= 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 1611951728047277.35932907913116; Fri, 29 Jan 2021 12:22:08 -0800 (PST) Received: from localhost ([::1]:35776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5aHO-00016A-Os for importer@patchew.org; Fri, 29 Jan 2021 15:22:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5a6l-0006ya-Si for qemu-devel@nongnu.org; Fri, 29 Jan 2021 15:11:07 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:46312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5a6j-0008Bd-Px for qemu-devel@nongnu.org; Fri, 29 Jan 2021 15:11:07 -0500 Received: by mail-pg1-x534.google.com with SMTP id r38so7387938pgk.13 for ; Fri, 29 Jan 2021 12:11:05 -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.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 12:11:03 -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=dgFs0kRvG3YRS9ydc6sjoVZGH6LkBq65P9PIXpXmt7w=; b=cNXI0V0Oi5eCMF5vCA+4sODl4eYEvcxDd6sAdeWEnAwhlSPpnL5dgDEh/16un4m3BC 9eLRff/Vw8cXJaxbgQ1N1g/voq/zUYk0M2kjB6B948t6S6xd6/sd9EcpBWN261f0jyJm 1FWTbJL6+2XIzzUH98FVB1DbgfqnmU4GeFAP0OSfbGjqzLhVnH0RPizPDqwiak61KsjH Cl/evRcjNvIpsGjx4FKhDnTY9I/FUK74VTH9Fnki/BY2NdW7ujNPrzK7r8jhzVI+Nooq GViPnUD3AdCSqt8M8BD39YfAw2bmVUTjQ1BzHikQnjoNP8HIWgBLACVYydxdMTX32Gah xpfg== 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=dgFs0kRvG3YRS9ydc6sjoVZGH6LkBq65P9PIXpXmt7w=; b=lFqvl9V6KYbIRyz0ophkqEgg/PZqepx3oG/o8JWJgpQAewq5iTOvT2fi2NWmbpjEmQ qpnb/E0TOigoElul4BA5ju4+vdCSgXim1YPdgO2CNa2MYaTK4D8j+JdO/1dKIYL5cnyv SiHewCtiHANqVRNazkEbsEwNsEK4+b8g7jQo3EZOfHeYBz3WfNWEnO4V1aE2h54cP0xO TvfxBd7l2j8XXeC+li5cKotyIl44Qjety+ip9K2yzMC+JGu01nJ7N1PENmkLzCcUFJ+j TBzi7hXUPE8jmnIWnGhBYdblr97eWueDF8agMvNyWFIizlRhJxRIHl0D7fistyM8sTZB HHPw== X-Gm-Message-State: AOAM5329lF77TklZdwP8yY9RD7Xig5R45lrK0J9jo+Eg5ENQmxYm1qWb 9JkV8pjdqm3tBQfW8R3Ro6kvOcMzlbbwY+u+ X-Google-Smtp-Source: ABdhPJx06ladUb1yBp/qBPiA1Sy/ym6z3VgHgcKgOeO28QK88vsODd+UzU3OEzrwz68oMbAl9aoJnQ== X-Received: by 2002:a05:6a00:a8f:b029:1bd:bb89:5911 with SMTP id b15-20020a056a000a8fb02901bdbb895911mr5738723pfl.42.1611951064412; Fri, 29 Jan 2021 12:11:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 20/24] tcg/riscv: Split out constraint sets to tcg-target-con-set.h Date: Fri, 29 Jan 2021 10:10:24 -1000 Message-Id: <20210129201028.787853-21-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::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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 , Alistair Francis 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 Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target-con-set.h | 30 ++++++++++++ tcg/riscv/tcg-target.h | 1 + tcg/riscv/tcg-target.c.inc | 83 ++++++++++------------------------ 3 files changed, 54 insertions(+), 60 deletions(-) create mode 100644 tcg/riscv/tcg-target-con-set.h diff --git a/tcg/riscv/tcg-target-con-set.h b/tcg/riscv/tcg-target-con-set.h new file mode 100644 index 0000000000..cf0ac4d751 --- /dev/null +++ b/tcg/riscv/tcg-target-con-set.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define RISC-V 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(LZ, L) +C_O0_I2(rZ, r) +C_O0_I2(rZ, rZ) +C_O0_I3(LZ, L, L) +C_O0_I3(LZ, LZ, L) +C_O0_I4(LZ, LZ, L, L) +C_O0_I4(rZ, rZ, rZ, rZ) +C_O1_I1(r, L) +C_O1_I1(r, r) +C_O1_I2(r, L, L) +C_O1_I2(r, r, ri) +C_O1_I2(r, r, rI) +C_O1_I2(r, rZ, rN) +C_O1_I2(r, rZ, rZ) +C_O1_I4(r, rZ, rZ, rZ, rZ) +C_O2_I1(r, r, L) +C_O2_I2(r, r, L, L) +C_O2_I4(r, r, rZ, rZ, rM, rM) diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 727c8df418..a998b951e4 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -171,5 +171,6 @@ void tb_target_set_jmp_target(uintptr_t, uintptr_t, uin= tptr_t, uintptr_t); #define TCG_TARGET_NEED_POOL_LABELS =20 #define TCG_TARGET_HAS_MEMORY_BSWAP 0 +#define TCG_TARGET_CON_SET_H =20 #endif diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 20d5b5ef01..e700c52067 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1543,50 +1543,11 @@ static void tcg_out_op(TCGContext *s, TCGOpcode 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 rZ_r - =3D { .args_ct_str =3D { "rZ", "r" } }; - static const TCGTargetOpDef rZ_rZ - =3D { .args_ct_str =3D { "rZ", "rZ" } }; - static const TCGTargetOpDef rZ_rZ_rZ_rZ - =3D { .args_ct_str =3D { "rZ", "rZ", "rZ", "rZ" } }; - 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_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_rZ_rZ_rZ_rZ - =3D { .args_ct_str =3D { "r", "rZ", "rZ", "rZ", "rZ" } }; - static const TCGTargetOpDef r_L - =3D { .args_ct_str =3D { "r", "L" } }; - 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_L_L - =3D { .args_ct_str =3D { "r", "r", "L", "L" } }; - static const TCGTargetOpDef LZ_L - =3D { .args_ct_str =3D { "LZ", "L" } }; - static const TCGTargetOpDef LZ_L_L - =3D { .args_ct_str =3D { "LZ", "L", "L" } }; - static const TCGTargetOpDef LZ_LZ_L - =3D { .args_ct_str =3D { "LZ", "LZ", "L" } }; - static const TCGTargetOpDef LZ_LZ_L_L - =3D { .args_ct_str =3D { "LZ", "LZ", "L", "L" } }; - static const TCGTargetOpDef r_r_rZ_rZ_rM_rM - =3D { .args_ct_str =3D { "r", "r", "rZ", "rZ", "rM", "rM" } }; - 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: @@ -1618,7 +1579,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_ext_i32_i64: - return &r_r; + return C_O1_I1(r, r); =20 case INDEX_op_st8_i32: case INDEX_op_st16_i32: @@ -1627,7 +1588,7 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpc= ode 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_and_i32: @@ -1637,11 +1598,11 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGO= pcode op) case INDEX_op_and_i64: case INDEX_op_or_i64: case INDEX_op_xor_i64: - return &r_r_rI; + return C_O1_I2(r, r, rI); =20 case INDEX_op_sub_i32: case INDEX_op_sub_i64: - return &r_rZ_rN; + return C_O1_I2(r, rZ, rN); =20 case INDEX_op_mul_i32: case INDEX_op_mulsh_i32: @@ -1659,7 +1620,7 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpc= ode op) case INDEX_op_rem_i64: case INDEX_op_remu_i64: case INDEX_op_setcond_i64: - return &r_rZ_rZ; + return C_O1_I2(r, rZ, rZ); =20 case INDEX_op_shl_i32: case INDEX_op_shr_i32: @@ -1667,39 +1628,41 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGO= pcode op) case INDEX_op_shl_i64: case INDEX_op_shr_i64: case INDEX_op_sar_i64: - return &r_r_ri; + return C_O1_I2(r, r, ri); =20 case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return &rZ_rZ; + return C_O0_I2(rZ, rZ); =20 case INDEX_op_add2_i32: case INDEX_op_add2_i64: case INDEX_op_sub2_i32: case INDEX_op_sub2_i64: - return &r_r_rZ_rZ_rM_rM; + return C_O2_I4(r, r, rZ, rZ, rM, rM); =20 case INDEX_op_brcond2_i32: - return &rZ_rZ_rZ_rZ; + return C_O0_I4(rZ, rZ, rZ, rZ); =20 case INDEX_op_setcond2_i32: - return &r_rZ_rZ_rZ_rZ; + return C_O1_I4(r, rZ, rZ, rZ, rZ); =20 case INDEX_op_qemu_ld_i32: - return TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS ? &r_L : &r_L_L; + return (TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS + ? C_O1_I1(r, L) : C_O1_I2(r, L, L)); case INDEX_op_qemu_st_i32: - return TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS ? &LZ_L : &LZ_L_L; + return (TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS + ? C_O0_I2(LZ, L) : C_O0_I3(LZ, L, L)); case INDEX_op_qemu_ld_i64: - return TCG_TARGET_REG_BITS =3D=3D 64 ? &r_L - : TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS ? &r_r_L - : &r_r_L_L; + return (TCG_TARGET_REG_BITS =3D=3D 64 ? C_O1_I1(r, L) + : TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS ? 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 ? &LZ_L - : TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS ? &LZ_LZ_L - : &LZ_LZ_L_L; + return (TCG_TARGET_REG_BITS =3D=3D 64 ? C_O0_I2(LZ, L) + : TARGET_LONG_BITS <=3D TCG_TARGET_REG_BITS ? C_O0_I3(LZ, L= Z, L) + : C_O0_I4(LZ, LZ, L, L)); =20 default: - return NULL; + g_assert_not_reached(); } } =20 --=20 2.25.1