From nobody Thu Nov 28 11:03:42 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694153196; cv=none; d=zohomail.com; s=zohoarc; b=kPDTTf1hHbZYBwQfC5NlQHD1yhgnwHzxz9fuf6HdQYGbYc3+tGif4Y42t/Nqk4KZIPY/L/8PJNNLquautC996jiIQMzPaifTei8NiSGX9fLxtvK+LWdimoRHLozICwhCiCHDSZXIEGq+rSy1QxWSY76YGWxfrMFjuhG/PDBefLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694153196; 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=fmxtFBhMNKgAclVFCJgIRWOiSmo6h51x/2XzyTwE3NU=; b=MQv3kDu+YqLQkvSxKE4MKLjzxW111ISaleWTG7jO4R0uhJKHGq9NQGiyurFKBLskypZnDuF1qMqfAzCc/MkmRp3oRKiBKXM2mAqJJ98w/DQyDPYhAJ0D6oVLdLnBrDsq3Y3BmT9vx5VMzyv+WzBZ7hJDloegCrONv0Tn2JUdXbY= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694153196490664.8837021670962; Thu, 7 Sep 2023 23:06:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeUcm-0000Gt-4V; Fri, 08 Sep 2023 02:05:48 -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 1qeUcj-0000DR-Bb for qemu-devel@nongnu.org; Fri, 08 Sep 2023 02:05:45 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeUcg-0005Zn-Vp for qemu-devel@nongnu.org; Fri, 08 Sep 2023 02:05:45 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bc8a2f71eeso14841555ad.0 for ; Thu, 07 Sep 2023 23:05:42 -0700 (PDT) Received: from toolbox.alistair23.me (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id q1-20020a170902dac100b001c3267ae31bsm715231plx.301.2023.09.07.23.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 23:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694153141; x=1694757941; darn=nongnu.org; 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=fmxtFBhMNKgAclVFCJgIRWOiSmo6h51x/2XzyTwE3NU=; b=E7BPykYoX5iT4QEB1DXAiLP7IcklVrLvVgkZdXog5uOkzlerG6jwRgJk8CMQeEYrue q5bLWAU/x7oOGIefpkSMySrK9bjkdLwD2tzT3zeGjk/vCt7UNEq6OadQteBu2LSJBo/Z JiQRb03HVidKiJ9ZuGcfuLpPulz1IAHr3aE4TPaT5fZKMkpgtHscBAyckKxtBO3M/4wj /Tdy6tTW4KTduaYRrNTIJ290GGn7Z7UleV1hzt4ib+kClu6H6vEgo+5w4fQ2P28QAOWv X0M61IaG8DjA4K7eQ9RYmc03Q7JC+2UP2f62aTvQYLisSDWvKVNDJzm6oVlXrtNm4YZe HGaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694153141; x=1694757941; 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=fmxtFBhMNKgAclVFCJgIRWOiSmo6h51x/2XzyTwE3NU=; b=FLUX/e0J0miLiYJ2EvHhXMoZIXl2fvtz0w+6K5ALUTYuTRHzZmWw++MwtP7TO7iC8W lOCwgs41tSMeNrA9flFlCnqBHqhNG7wnA+4e7jGY9qCc19150FFQiHmlqSa/wXMyGfKp W+3mCIrVtbS1BNGVTeDuglBTN2GB8pUb5aMTWeqR/y6PEAZc2JN11y80LqM7TrCf3//z 86QG1hQiXe/kulldeGEq5DnHe1Jv8QOoqlP6VWelnk2G1mgxIaT3fOGYqLGfd0d2wF6h 60WI69+yGtGgsDAnztEernEs1PbUeEbS2XikOIm/At63gBw7yBdYu5F6Qu0I/mzwPIvh FqzQ== X-Gm-Message-State: AOJu0YwYwbJnqykLDhqCPGYz+unUvp5T9wmcXJMCiJkM8c5KgQkxJHlI RRjru6zFKusClQ6uiaWR84945k5xIGPudhS/ X-Google-Smtp-Source: AGHT+IFLp2ZnplWZ5yJuV1DbIJWm5KM0iGJcioXLnMJ3GwFLD4r/EpbWW3OXXqB3CnLr3Q2p6Ea92w== X-Received: by 2002:a17:902:b497:b0:1c3:61d9:2b32 with SMTP id y23-20020a170902b49700b001c361d92b32mr1400350plr.45.1694153141395; Thu, 07 Sep 2023 23:05:41 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Nazar Kazakov , Richard Henderson , Weiwei Li , Max Chou , Alistair Francis Subject: [PULL 12/65] target/riscv: Move vector translation checks Date: Fri, 8 Sep 2023 16:03:38 +1000 Message-ID: <20230908060431.1903919-13-alistair.francis@wdc.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230908060431.1903919-1-alistair.francis@wdc.com> References: <20230908060431.1903919-1-alistair.francis@wdc.com> 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::62f; envelope-from=alistair23@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694153198551100005 Content-Type: text/plain; charset="utf-8" From: Nazar Kazakov Move the checks out of `do_opiv{v,x,i}_gvec{,_shift}` functions and into the corresponding macros. This enables the functions to be reused in proceeding commits without check duplication. Signed-off-by: Nazar Kazakov Reviewed-by: Richard Henderson Reviewed-by: Weiwei Li Signed-off-by: Max Chou Message-ID: <20230711165917.2629866-6-max.chou@sifive.com> Signed-off-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 28 +++++++++++-------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_tr= ans/trans_rvv.c.inc index 7e194aae34..5dfd524c7d 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -1183,9 +1183,6 @@ do_opivv_gvec(DisasContext *s, arg_rmrr *a, GVecGen3F= n *gvec_fn, gen_helper_gvec_4_ptr *fn) { TCGLabel *over =3D gen_new_label(); - if (!opivv_check(s, a)) { - return false; - } =20 tcg_gen_brcond_tl(TCG_COND_GEU, cpu_vstart, cpu_vl, over); =20 @@ -1218,6 +1215,9 @@ static bool trans_##NAME(DisasContext *s, arg_rmrr *a= ) \ gen_helper_##NAME##_b, gen_helper_##NAME##_h, \ gen_helper_##NAME##_w, gen_helper_##NAME##_d, \ }; \ + if (!opivv_check(s, a)) { \ + return false; \ + } \ return do_opivv_gvec(s, a, tcg_gen_gvec_##SUF, fns[s->sew]); \ } =20 @@ -1276,10 +1276,6 @@ static inline bool do_opivx_gvec(DisasContext *s, arg_rmrr *a, GVecGen2sFn *gvec_fn, gen_helper_opivx *fn) { - if (!opivx_check(s, a)) { - return false; - } - if (a->vm && s->vl_eq_vlmax && !(s->vta && s->lmul < 0)) { TCGv_i64 src1 =3D tcg_temp_new_i64(); =20 @@ -1301,6 +1297,9 @@ static bool trans_##NAME(DisasContext *s, arg_rmrr *a= ) \ gen_helper_##NAME##_b, gen_helper_##NAME##_h, \ gen_helper_##NAME##_w, gen_helper_##NAME##_d, \ }; \ + if (!opivx_check(s, a)) { \ + return false; \ + } \ return do_opivx_gvec(s, a, tcg_gen_gvec_##SUF, fns[s->sew]); \ } =20 @@ -1432,10 +1431,6 @@ static inline bool do_opivi_gvec(DisasContext *s, arg_rmrr *a, GVecGen2iFn *gvec_fn, gen_helper_opivx *fn, imm_mode_t imm_mode) { - if (!opivx_check(s, a)) { - return false; - } - if (a->vm && s->vl_eq_vlmax && !(s->vta && s->lmul < 0)) { gvec_fn(s->sew, vreg_ofs(s, a->rd), vreg_ofs(s, a->rs2), extract_imm(s, a->rs1, imm_mode), MAXSZ(s), MAXSZ(s)); @@ -1453,6 +1448,9 @@ static bool trans_##NAME(DisasContext *s, arg_rmrr *a= ) \ gen_helper_##OPIVX##_b, gen_helper_##OPIVX##_h, \ gen_helper_##OPIVX##_w, gen_helper_##OPIVX##_d, \ }; \ + if (!opivx_check(s, a)) { \ + return false; \ + } \ return do_opivi_gvec(s, a, tcg_gen_gvec_##SUF, \ fns[s->sew], IMM_MODE); \ } @@ -1775,10 +1773,6 @@ static inline bool do_opivx_gvec_shift(DisasContext *s, arg_rmrr *a, GVecGen2sFn32 *gvec_fn, gen_helper_opivx *fn) { - if (!opivx_check(s, a)) { - return false; - } - if (a->vm && s->vl_eq_vlmax && !(s->vta && s->lmul < 0)) { TCGv_i32 src1 =3D tcg_temp_new_i32(); =20 @@ -1800,7 +1794,9 @@ static bool trans_##NAME(DisasContext *s, arg_rmrr *a= ) \ gen_helper_##NAME##_b, gen_helper_##NAME##_h, \ gen_helper_##NAME##_w, gen_helper_##NAME##_d, \ }; \ - \ + if (!opivx_check(s, a)) { \ + return false; \ + } \ return do_opivx_gvec_shift(s, a, tcg_gen_gvec_##SUF, fns[s->sew]); \ } =20 --=20 2.41.0