From nobody Mon Nov 25 03:38:54 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=1718830931; cv=none; d=zohomail.com; s=zohoarc; b=N+j79ktCFUdPZZQaPCCWDuPutT4tQk4zQID+sbwJrAExQUqCtpD4eOma0sPZbTS2FXQpxQIMxYLC1AdKf2UQW+9aMTNp23VXEBo7kkH6vsjl2LvkBudJ3yRjmBGq6hef8W1GgfiDcJwefhyfr3sll3eyEkACwxLKPdpSEfVpums= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718830931; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=QaWwTBCdRRXgMoR1CYWn0PFxysR4ccqinTVsqlx0hVw=; b=J9Y+XZoqdDKRNOIRFpI8rqg3QmkvmKL/5iYbXHRf9iz3M40GcaoFE5miliBT3C3OrPcfYlHxRGH7NyFFKchzx+4X0JnZIzBtZXV9yoyRw0LR/dnZte+Ail/DUE0X3YYntoJMcpEEJZoaceHSuD/qEa9N1et4o3uRpjt19TZXStY= 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 1718830931629469.20619710296614; Wed, 19 Jun 2024 14:02:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sK2Pf-0002IX-5r; Wed, 19 Jun 2024 17:00:15 -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 1sK2Pd-0002Gd-LA for qemu-devel@nongnu.org; Wed, 19 Jun 2024 17:00:13 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK2Pa-0000bD-Cw for qemu-devel@nongnu.org; Wed, 19 Jun 2024 17:00:13 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-6e4dbca52f0so177575a12.0 for ; Wed, 19 Jun 2024 14:00:09 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f98f8f8c42sm39183765ad.162.2024.06.19.14.00.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 14:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718830808; x=1719435608; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QaWwTBCdRRXgMoR1CYWn0PFxysR4ccqinTVsqlx0hVw=; b=d6nK09VswNkxvHfRMkGC3tlhKGZxyNEo73nHhILruNeo2XyoKY8POQojy8mibc4ikb m/SWka26+B3iDYr/iPN5cMhfqM2y3dhPEacXhVLPyK9FrnUpAzBUWkv5Zix0xxSeKEEd ewXpiqtgXwXFMA8y6Ncmn1rgeQc9BOsiIgBfFQcGRTuT3AxbnpUKHw29LNHmIfou2E6K kGQVG718wwCPe9luqJ6o2Xrpp/2SsN5vcHMvM9DleXHNGXVFMJrxYCVoz45a4TBQtcTZ ygxxGHN4TUScP6/ZETbFmxbl3gxGEaEWd++qg7XPwHUnqNxeY+kDc8yWS7Otq2n5vmhq jvCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718830808; x=1719435608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QaWwTBCdRRXgMoR1CYWn0PFxysR4ccqinTVsqlx0hVw=; b=CvsxTn9i+fwJoSHUiZwE9+rEN6lY6XWsLf+IxFlFIAMfvJXAmCt5+tAljzRBv7DT3o xg3Zrq4uf3wNZky//j7Nc8SMIfL4OJ9tipNgTpwYGL7DSejETVwvW+hT8/VWozq+Biq8 sQgJBn9PdppvQrlKomPh4LJ1QTTieOdk8WB92hdYRCYjXR2QaUjaYbOHETMSEdIfMkcl rV8ZjkL7l+nrl6iz/2LkddfEsdxS3zCRy6aRJ0KewpHzBb6pP2ylxZSaUn7inyk9Kk41 oLvS4XgQmf7JbZQV9BdOV13CspF5lZKFz3/uam9YAfMf1Wf0IgDko5VozgMOKLHTKTP8 JCUg== X-Gm-Message-State: AOJu0YwDzpcMjD9RKTKfd3PksmAkRoZ4TzTQTtk61/JCl9jGuNYPQGrT UFnqVBNrVtE9WPd1WJb7ZbsXQCXx9FEegiA9hMfqiXbND2L+p11Jv9B+xKUSxtI1CEfDmvIyJ50 X X-Google-Smtp-Source: AGHT+IFBPAAi4IafUNmYocEa0YmJjARDNTBdvbuhTLEmIg1uQIFffD35FpTJCBccHRDIBGZk/dZNew== X-Received: by 2002:a17:903:11ce:b0:1f4:b859:cb60 with SMTP id d9443c01a7336-1f9aa396f5amr39165055ad.10.1718830806656; Wed, 19 Jun 2024 14:00:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/24] tcg/loongarch64: Split out vdvjvk in tcg_out_vec_op Date: Wed, 19 Jun 2024 13:59:41 -0700 Message-Id: <20240619205952.235946-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240619205952.235946-1-richard.henderson@linaro.org> References: <20240619205952.235946-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::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1718830932724100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 119 ++++++++++++++++--------------- 1 file changed, 63 insertions(+), 56 deletions(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.= c.inc index 652aa261a3..8f5f38aa0a 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1900,49 +1900,55 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode= opc, tcg_out_ld(s, type, a0, a1, a2); break; case INDEX_op_and_vec: - tcg_out_opc_vand_v(s, a0, a1, a2); - break; + insn =3D OPC_VAND_V; + goto vdvjvk; case INDEX_op_andc_vec: /* * vandn vd, vj, vk: vd =3D vk & ~vj * andc_vec vd, vj, vk: vd =3D vj & ~vk - * vk and vk are swapped + * vj and vk are swapped */ - tcg_out_opc_vandn_v(s, a0, a2, a1); - break; + a1 =3D a2; + a2 =3D args[1]; + insn =3D OPC_VANDN_V; + goto vdvjvk; case INDEX_op_or_vec: - tcg_out_opc_vor_v(s, a0, a1, a2); - break; + insn =3D OPC_VOR_V; + goto vdvjvk; case INDEX_op_orc_vec: - tcg_out_opc_vorn_v(s, a0, a1, a2); - break; + insn =3D OPC_VORN_V; + goto vdvjvk; case INDEX_op_xor_vec: - tcg_out_opc_vxor_v(s, a0, a1, a2); - break; - case INDEX_op_nor_vec: - tcg_out_opc_vnor_v(s, a0, a1, a2); - break; + insn =3D OPC_VXOR_V; + goto vdvjvk; case INDEX_op_not_vec: - tcg_out_opc_vnor_v(s, a0, a1, a1); - break; + a2 =3D a1; + /* fall through */ + case INDEX_op_nor_vec: + insn =3D OPC_VNOR_V; + goto vdvjvk; case INDEX_op_cmp_vec: { TCGCond cond =3D args[3]; + if (const_args[2]) { /* * cmp_vec dest, src, value * Try vseqi/vslei/vslti */ int64_t value =3D sextract64(a2, 0, 8 << vece); - if ((cond =3D=3D TCG_COND_EQ || cond =3D=3D TCG_COND_LE ||= \ - cond =3D=3D TCG_COND_LT) && (-0x10 <=3D value && valu= e <=3D 0x0f)) { - tcg_out32(s, encode_vdvjsk5_insn(cmp_vec_imm_insn[cond= ][vece], \ - a0, a1, value)); + if ((cond =3D=3D TCG_COND_EQ || + cond =3D=3D TCG_COND_LE || + cond =3D=3D TCG_COND_LT) && + (-0x10 <=3D value && value <=3D 0x0f)) { + insn =3D cmp_vec_imm_insn[cond][vece]; + tcg_out32(s, encode_vdvjsk5_insn(insn, a0, a1, value)); break; - } else if ((cond =3D=3D TCG_COND_LEU || cond =3D=3D TCG_CO= ND_LTU) && - (0x00 <=3D value && value <=3D 0x1f)) { - tcg_out32(s, encode_vdvjuk5_insn(cmp_vec_imm_insn[cond= ][vece], \ - a0, a1, value)); + } else if ((cond =3D=3D TCG_COND_LEU || + cond =3D=3D TCG_COND_LTU) && + (0x00 <=3D value && value <=3D 0x1f)) { + insn =3D cmp_vec_imm_insn[cond][vece]; + tcg_out32(s, encode_vdvjuk5_insn(insn, a0, a1, value)); break; } =20 @@ -1963,9 +1969,8 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode o= pc, insn =3D cmp_vec_insn[cond][vece]; tcg_debug_assert(insn !=3D 0); } - tcg_out32(s, encode_vdvjvk_insn(insn, a0, a1, a2)); } - break; + goto vdvjvk; case INDEX_op_add_vec: tcg_out_addsub_vec(s, false, vece, a0, a1, a2, const_args[2], true= ); break; @@ -1976,41 +1981,41 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode= opc, tcg_out32(s, encode_vdvj_insn(neg_vec_insn[vece], a0, a1)); break; case INDEX_op_mul_vec: - tcg_out32(s, encode_vdvjvk_insn(mul_vec_insn[vece], a0, a1, a2)); - break; + insn =3D mul_vec_insn[vece]; + goto vdvjvk; case INDEX_op_smin_vec: - tcg_out32(s, encode_vdvjvk_insn(smin_vec_insn[vece], a0, a1, a2)); - break; + insn =3D smin_vec_insn[vece]; + goto vdvjvk; case INDEX_op_smax_vec: - tcg_out32(s, encode_vdvjvk_insn(smax_vec_insn[vece], a0, a1, a2)); - break; + insn =3D smax_vec_insn[vece]; + goto vdvjvk; case INDEX_op_umin_vec: - tcg_out32(s, encode_vdvjvk_insn(umin_vec_insn[vece], a0, a1, a2)); - break; + insn =3D umin_vec_insn[vece]; + goto vdvjvk; case INDEX_op_umax_vec: - tcg_out32(s, encode_vdvjvk_insn(umax_vec_insn[vece], a0, a1, a2)); - break; + insn =3D umax_vec_insn[vece]; + goto vdvjvk; case INDEX_op_ssadd_vec: - tcg_out32(s, encode_vdvjvk_insn(ssadd_vec_insn[vece], a0, a1, a2)); - break; + insn =3D ssadd_vec_insn[vece]; + goto vdvjvk; case INDEX_op_usadd_vec: - tcg_out32(s, encode_vdvjvk_insn(usadd_vec_insn[vece], a0, a1, a2)); - break; + insn =3D usadd_vec_insn[vece]; + goto vdvjvk; case INDEX_op_sssub_vec: - tcg_out32(s, encode_vdvjvk_insn(sssub_vec_insn[vece], a0, a1, a2)); - break; + insn =3D sssub_vec_insn[vece]; + goto vdvjvk; case INDEX_op_ussub_vec: - tcg_out32(s, encode_vdvjvk_insn(ussub_vec_insn[vece], a0, a1, a2)); - break; + insn =3D ussub_vec_insn[vece]; + goto vdvjvk; case INDEX_op_shlv_vec: - tcg_out32(s, encode_vdvjvk_insn(shlv_vec_insn[vece], a0, a1, a2)); - break; + insn =3D shlv_vec_insn[vece]; + goto vdvjvk; case INDEX_op_shrv_vec: - tcg_out32(s, encode_vdvjvk_insn(shrv_vec_insn[vece], a0, a1, a2)); - break; + insn =3D shrv_vec_insn[vece]; + goto vdvjvk; case INDEX_op_sarv_vec: - tcg_out32(s, encode_vdvjvk_insn(sarv_vec_insn[vece], a0, a1, a2)); - break; + insn =3D sarv_vec_insn[vece]; + goto vdvjvk; case INDEX_op_shli_vec: tcg_out32(s, encode_vdvjuk3_insn(shli_vec_insn[vece], a0, a1, a2)); break; @@ -2020,15 +2025,14 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode= opc, case INDEX_op_sari_vec: tcg_out32(s, encode_vdvjuk3_insn(sari_vec_insn[vece], a0, a1, a2)); break; - case INDEX_op_rotrv_vec: - tcg_out32(s, encode_vdvjvk_insn(rotrv_vec_insn[vece], a0, a1, a2)); - break; case INDEX_op_rotlv_vec: /* rotlv_vec a1, a2 =3D rotrv_vec a1, -a2 */ tcg_out32(s, encode_vdvj_insn(neg_vec_insn[vece], temp_vec, a2)); - tcg_out32(s, encode_vdvjvk_insn(rotrv_vec_insn[vece], a0, a1, - temp_vec)); - break; + a2 =3D temp_vec; + /* fall through */ + case INDEX_op_rotrv_vec: + insn =3D rotrv_vec_insn[vece]; + goto vdvjvk; case INDEX_op_rotli_vec: /* rotli_vec a1, a2 =3D rotri_vec a1, -a2 */ a2 =3D extract32(-a2, 0, 3 + vece); @@ -2058,6 +2062,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode o= pc, break; default: g_assert_not_reached(); + vdvjvk: + tcg_out32(s, encode_vdvjvk_insn(insn, a0, a1, a2)); + break; } } =20 --=20 2.34.1