From nobody Sun Nov 24 07:28:23 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=1726073595; cv=none; d=zohomail.com; s=zohoarc; b=ntqF6ZCiitI5tS+Z/c6Tr5l8o2cXTlRFRpC6exvVT/CP34DFyWQ1Ax3ba7cB5QFmh4/f4ONvLOh6ZFOFgPGExQd7RxHmCAgSditEoPVaPmrmeGYDKS30F+afM2blJcuytQVsvcJDSaSNc9sKSuCplJXYSbJP9iv7+Kn5u4Oblbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726073595; h=Content-Transfer-Encoding:Cc:Cc: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; bh=zmsViYQuZcRw3+Xw3xnkrlUzHZT6vqkjOcHzmQVj1eI=; b=LWJ9TarDpLvhghqj7nTcUEzAOdHVcsvhGyvs7hDlRfIL7i8qdP7nWNuNNQ5chN+DFV9RsaLYQL+nfHgysLXj9vvoso4bhWhtxsy7+Hi6yELjAZ1xLFKcgrSHQ5qICE2jNypJUmB3eETaAM7eyDuPrpfyD61Kwbb2dD4rTwH5pIc= 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 17260735956241006.5362067958752; Wed, 11 Sep 2024 09:53:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soQYn-00032K-9x; Wed, 11 Sep 2024 12:51:17 -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 1soQYa-0002Uw-PA for qemu-devel@nongnu.org; Wed, 11 Sep 2024 12:51:04 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soQYY-0003gY-V2 for qemu-devel@nongnu.org; Wed, 11 Sep 2024 12:51:04 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-71790ed8c2dso6096634b3a.3 for ; Wed, 11 Sep 2024 09:51:02 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71908fe4e7esm3186947b3a.80.2024.09.11.09.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 09:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726073461; x=1726678261; 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=zmsViYQuZcRw3+Xw3xnkrlUzHZT6vqkjOcHzmQVj1eI=; b=K+6c07qMAeWsb/aUfoN1xs232iauJXkiIzfL7sNkj1x4SSkgL9MPmcSwaZJQuQLu3u hFrCvq2vnrYJBtdrVmMrnque1d0mfgOL7DgS36rkPt94av9xFvlBi4TOmMb8frqOGQiI IY3vysIIJWcmgtskbIDCTpmmFfPt7ilpCuOlFld9I5N1U48RvlqrdwDkoxbQTsEAWFoS ymMXAxmTsxnuyzM72VdTpeAunSwpaa/99HNw5iwTaAqp8yrjWYsQ+NIdvpCzoeB2Coui ZgE14P0K/cHb83LY8LMybAgvjsburHUMkHiYjVGYq8AbKHs8Osvw8SutjvGUiWc+/YU8 dsDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726073461; x=1726678261; 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=zmsViYQuZcRw3+Xw3xnkrlUzHZT6vqkjOcHzmQVj1eI=; b=fP0QBsBoqodmLJYQkFbhkboP2WoSfuu67V2o7t0KrLMSs/OdZbhuP7oKcCLnoW4sxL iHP7iGqPV832bkoGSEyLfI2/QIdWXQnI9FIHnkh9rcHKxLi0ipngqlOt4qvqxS6ZFH36 j1yXMj7GLYPDbQvJSoBPfx7TT8m389bdn8A8GcGPDWiEIaJrPR775LtybhTw7U1P9UIR Sy57tXhDO3T+EN1cNIx0yDP4ecin6HhJeW1ybMn1gM7tqvEvm8vy7kOCtBFBms3FJYbg EQ9D8mrDF1r2NTWktVCYNkzI94clrLX2pVSizQZRZK5Lbn5GyukRfqrTO+XoIVg6zoj0 0K+g== X-Gm-Message-State: AOJu0YzNfrJBz18Qjm3cvpsX5Lju/rmUj+TNHbrBcYTk+b7DeLX6K1oq o7evtUX0uslrgnszBp0MdsvUpXLicJjzTqm6CT1WHJg0PBEP5mZdGRunr16Hb6CHn5G0VCueZn8 V X-Google-Smtp-Source: AGHT+IE6NjEYdSTgX3awPXzNLWY1wgb/qkt4rZEyTSNYsc74ZE/sU+YKHHoN8ApBWQDXH7+gmcektQ== X-Received: by 2002:a05:6a00:218f:b0:70d:2892:402b with SMTP id d2e1a72fcca58-7192608123fmr18890b3a.7.1726073461551; Wed, 11 Sep 2024 09:51:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: zhiwei_liu@linux.alibaba.com, tangtiancheng.ttc@alibaba-inc.com, philmd@linaro.org Subject: [PATCH v2 13/18] tcg/i386: Implement cmpsel_vec with avx512 insns Date: Wed, 11 Sep 2024 09:50:42 -0700 Message-ID: <20240911165047.1035764-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911165047.1035764-1-richard.henderson@linaro.org> References: <20240911165047.1035764-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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1726073596839116600 Content-Type: text/plain; charset="utf-8" The avx512 vpblendm* instructions exactly implement cmpsel, using a predicate input. Of course this matches nicely with the avx512 predicate comparison instructions. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index f94a2a2385..d473dc7a5e 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -413,6 +413,10 @@ static bool tcg_target_const_match(int64_t val, int ct, #define OPC_UD2 (0x0b | P_EXT) #define OPC_VPBLENDD (0x02 | P_EXT3A | P_DATA16) #define OPC_VPBLENDVB (0x4c | P_EXT3A | P_DATA16) +#define OPC_VPBLENDMB (0x66 | P_EXT38 | P_DATA16 | P_EVEX) +#define OPC_VPBLENDMW (0x66 | P_EXT38 | P_DATA16 | P_VEXW | P_EVEX) +#define OPC_VPBLENDMD (0x64 | P_EXT38 | P_DATA16 | P_EVEX) +#define OPC_VPBLENDMQ (0x64 | P_EXT38 | P_DATA16 | P_VEXW | P_EVEX) #define OPC_VPCMPB (0x3f | P_EXT3A | P_DATA16 | P_EVEX) #define OPC_VPCMPUB (0x3e | P_EXT3A | P_DATA16 | P_EVEX) #define OPC_VPCMPW (0x3f | P_EXT3A | P_DATA16 | P_VEXW | P_EVEX) @@ -738,6 +742,16 @@ static void tcg_out_vex_modrm_type(TCGContext *s, int = opc, tcg_out_vex_modrm(s, opc, r, v, rm); } =20 +static void tcg_out_evex_modrm_type(TCGContext *s, int opc, int r, int v, + int rm, int aaa, bool z, TCGType type) +{ + if (type =3D=3D TCG_TYPE_V256) { + opc |=3D P_VEXL; + } + tcg_out_evex_opc(s, opc, r, v, rm, 0, aaa, z); + tcg_out8(s, 0xc0 | (LOWREGMASK(r) << 3) | LOWREGMASK(rm)); +} + /* Output an opcode with a full "rm + (index<