From patchwork Sat Sep 16 03:29:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 723580 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp710451wro; Fri, 15 Sep 2023 20:39:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHkjfOY5/Bbz3XYe3/v4Vk1ipOV5rBQvF3j/lsIrcez4TsY5sBZFuUmj42Dc6EHUMBTKKi X-Received: by 2002:a05:622a:1883:b0:412:23a3:9ed5 with SMTP id v3-20020a05622a188300b0041223a39ed5mr3529359qtc.25.1694835542618; Fri, 15 Sep 2023 20:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694835542; cv=none; d=google.com; s=arc-20160816; b=YUtU6HqkDLZpBNK30J2YXEtRVezVEFgi+VOJm7fiifEdy1W9/CG+m8tw6rypyBOMYi Kw4Hlx9T74fKFL5Y1HTIaLIzIxLjpgIYunKJ9ZVtShlitU1/n9/xjhRUlLHgW4D30OEG GMHukA4y9sQ0cRlbyv6sdB/jUEQ9swEn0jl0rQgqwyZHYy/tTQQvLnMt4VwUOVN2OjEE wT7l3n+W98kIyqhkuxAwbP2U52PxODFHNwXQxBPVTZ35sgDMIOjMYcuu5jwK/708fNzP lxJyf0Qh508BUyLXs7Dd4HJim7iuh7nFrIKVuJc+6XXkQfyeYH9EJn3pkebq/UdUqe+G 9JBQ== 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=5dphprXiVkWukG2aEdEE9+dyRDyj0wtRjPfPE48D/nE=; fh=XdZcuDF0lIDVBff2CYkB4/gQzRNs362lYRoE1KF8IAU=; b=Jpil8W3esUv1Ng6ks7EtppylMSShYPfeYilv1fhRChShIE7AlTPokXyRxHvv3WdAnx eqaiLVGb/+v+Z/wiKn5e2gAJHkQBOaAIIpwjP+jmiueBG6QDiuE3JHxMZsIKOq50AVdb pDyvz+Bh9UFDu+b8p4ByIz74yfCMNXdsR2MM9i/6fLirBSGmqty3CjUDx2WJKP7WCSH3 Sn9K6xgCiElVmBDe3EXJGBVQmNoCtxypL2LFU5gz3ocqbmq7wktQMrYON15J4s8SZ+jr iS90KIa4rw+ZY8SPn2hbBNUq0rQmLjzqJeL8lWpjPtm9CIRzvH7gn8A0kT2VTc6bugRz efyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rAwDXOfh; 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 g1-20020ac87f41000000b00403b0f6661asi3209102qtk.94.2023.09.15.20.39.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2023 20:39:02 -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=rAwDXOfh; 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 1qhM0u-0005yo-SV; Fri, 15 Sep 2023 23:30:32 -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 1qhM0q-0005wl-SN for qemu-devel@nongnu.org; Fri, 15 Sep 2023 23:30:28 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhM0p-00081D-6H for qemu-devel@nongnu.org; Fri, 15 Sep 2023 23:30:28 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-68fb6fd2836so2583244b3a.0 for ; Fri, 15 Sep 2023 20:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694835025; x=1695439825; 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=5dphprXiVkWukG2aEdEE9+dyRDyj0wtRjPfPE48D/nE=; b=rAwDXOfhTyg+4kCUTzS1L+EKE7lKnVfoFitYjpDi6+8cSPoyHeMJi67U3dtJ/RugEQ a5yW++B1PHlmiTPoBcZcWzTjli6SeJzqEAW2NvzBcKwj5F1uYyE4Qzl9MJ/aRS4PB8oq u4mjWknhxR+mbdA6Zjkm4EYdsW6z+dZBsfQmlStHqfu04yYBpGCseceIRmyrSf2LZuvG xV8b2Fsm8lohAg94kd7rZjJmRexJUHtQ5Y2ZrYmRD8k5uu1S7ckSdimgn7M98GBRJLIr lkJk1BTbJey6JSDCahEmINFubd3b/FU8o0gwDUGSl4LanAdVBCqRh0buZyRwo8bCDKAj CYgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694835025; x=1695439825; 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=5dphprXiVkWukG2aEdEE9+dyRDyj0wtRjPfPE48D/nE=; b=Fesd3TsBt9t2cOMQM9pHUfYXAQZYPvMnws5y/InodcTl6u6S+bi7Pzaa6HEQvF44mv YAM4jyhRD2nJlW21SNbXMaa0utno0tmHPRlri0dHs77QoPXd6Fr6bFxHgULWNpLaP5Mh QGG1UfQpmm1FrTqsOWqEF9h6IiI4pX3QesueACXwd5epNYifBBtkMTVUinBbmHnI7cXj hcohdH4tcgyBnhisiW2emR8uhRv6UqaS/npGpx9nrydrZjhPJr2EdXzpeEYugQ8pW9o+ lc35QFC58U+rhtMwkgjR4QirpIlNN2Wf0kCorYTsn0tPWAH1rFYSDb//dg775Sfldby9 H71Q== X-Gm-Message-State: AOJu0YwuDp1PFiDqAXA39JgWlvkJXjmfSFJE59V1FO+1KjA1V4deONWN DwUwWbv89sZjTv3RLTstYMKis+tiA1ApxUd+4+0= X-Received: by 2002:a05:6a00:c96:b0:68f:d864:596 with SMTP id a22-20020a056a000c9600b0068fd8640596mr4297267pfv.3.1694835025616; Fri, 15 Sep 2023 20:30:25 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id j26-20020aa783da000000b00687a4b70d1esm3577320pfn.218.2023.09.15.20.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 20:30:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Jiajie Chen Subject: [PULL 13/39] tcg/loongarch64: Lower mul_vec to vmul Date: Fri, 15 Sep 2023 20:29:45 -0700 Message-Id: <20230916033011.479144-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916033011.479144-1-richard.henderson@linaro.org> References: <20230916033011.479144-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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.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 From: Jiajie Chen Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Message-Id: <20230908022302.180442-9-c@jia.je> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.h | 2 +- tcg/loongarch64/tcg-target.c.inc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 64c72d0857..2c2266ed31 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -185,7 +185,7 @@ extern bool use_lsx_instructions; #define TCG_TARGET_HAS_nand_vec 0 #define TCG_TARGET_HAS_nor_vec 1 #define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_mul_vec 0 +#define TCG_TARGET_HAS_mul_vec 1 #define TCG_TARGET_HAS_shi_vec 0 #define TCG_TARGET_HAS_shs_vec 0 #define TCG_TARGET_HAS_shv_vec 0 diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index b36b706e39..0814f62905 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1698,6 +1698,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, static const LoongArchInsn neg_vec_insn[4] = { OPC_VNEG_B, OPC_VNEG_H, OPC_VNEG_W, OPC_VNEG_D }; + static const LoongArchInsn mul_vec_insn[4] = { + OPC_VMUL_B, OPC_VMUL_H, OPC_VMUL_W, OPC_VMUL_D + }; a0 = args[0]; a1 = args[1]; @@ -1799,6 +1802,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_neg_vec: 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; case INDEX_op_dupm_vec: tcg_out_dupm_vec(s, type, vece, a0, a1, a2); break; @@ -1825,6 +1831,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_nor_vec: case INDEX_op_not_vec: case INDEX_op_neg_vec: + case INDEX_op_mul_vec: return 1; default: return 0; @@ -1999,6 +2006,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_orc_vec: case INDEX_op_xor_vec: case INDEX_op_nor_vec: + case INDEX_op_mul_vec: return C_O1_I2(w, w, w); case INDEX_op_not_vec: