From patchwork Thu Mar 3 20:59:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 547823 Delivered-To: patch@linaro.org Received: by 2002:ac0:f585:0:0:0:0:0 with SMTP id s5csp983553imq; Thu, 3 Mar 2022 13:10:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUhPFWjwQQp44HebcnEg3TjFD0Q+Afn3pubpviNu8gqo5AoTfG3OeC08tpZ4qOzaaFUAPK X-Received: by 2002:a81:7741:0:b0:2dc:3039:40b0 with SMTP id s62-20020a817741000000b002dc303940b0mr6268640ywc.26.1646341850995; Thu, 03 Mar 2022 13:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646341850; cv=none; d=google.com; s=arc-20160816; b=rfPYak9Oy5sBPnwZVDIVbpuqbltuNEIfbqW+WF/FgtCcv8iba+p7uGtUHDS9odkufl aBR9XKTpFvgtzX66p2Qvx+zxZPRBlWk7wr3zK8BovSpkVWtVpic0CV40jAR2IAQ+PcIt +04q3Ps8TuqDz9U/4wStuX2u5Ft1HioK0h0WqP5sIhWeq9cK4+eZTV92VOHSVHisUr3P m32wwPwF8UgMylJmbwHvQAlogb92G/zjEgbYuVI+bhlRu0TnqU4UZ9jWfn3nro7HdNPS jZLlGQqoTIXqwSr6Cg3u1rWy21pGd1PDFObKlPpJs5IspJ3cmWgrtH+b1EGBmpTuOdmV mUdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=NVZxBYjya/bVlEFKs7qigQ6ua4ofT68Gshv8z31H2EM=; b=syyt1xyIAqV5p8NnmRTSD8vVa7OVUb/Lazwy2OlHQ19EydcWpE7xv3Kaw/ImeMAaPw xwYStynwu/TN8B+2KEsKKn6zASy6xmT1Fdo0bDObTtu8gQ0KodoU6Ogz81YrobLZj6Ry 7rQ37uNyQhnSznwB2FiLm+qLmnUQvIxcU9nPolIt1YX5TL/oPMdmVf5C3JF7L2nJCTb+ sfB6OBjlAKcyik6c/CdjbOxPnx/Hzu9wnw57WL35i6QKOel8Jst1HGwIBIfdUTbxVjgW dTxpe8VOGX/gGG+h+Sguzt72o4G53+ox3dVnvvxxEBr8Lz0ZspDPM9KxAv5LJDyjbqK0 OE+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WaUA0hnt; 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 n10-20020a81c80a000000b002db3922241dsi2691845ywi.81.2022.03.03.13.10.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Mar 2022 13:10:50 -0800 (PST) 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=WaUA0hnt; 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]:52864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPsio-0007qI-F4 for patch@linaro.org; Thu, 03 Mar 2022 16:10:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPsYP-0005sK-TP for qemu-devel@nongnu.org; Thu, 03 Mar 2022 16:00:05 -0500 Received: from [2607:f8b0:4864:20::62f] (port=44677 helo=mail-pl1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPsYO-00046g-Ac for qemu-devel@nongnu.org; Thu, 03 Mar 2022 16:00:05 -0500 Received: by mail-pl1-x62f.google.com with SMTP id q11so5850817pln.11 for ; Thu, 03 Mar 2022 13:00: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=NVZxBYjya/bVlEFKs7qigQ6ua4ofT68Gshv8z31H2EM=; b=WaUA0hnt0W0ZkrD7Q9SZu3e+9pJWlMDZu59Kx8tjiOdbhNjQJ6jj5FrQgSfwv62MuX Xvo+btsFa1jSrF/sPEfnuri/mKlOpBeULV3bsjEIVNcUh0uuc1ayBoqFwMi6bDrIR3QX E9b6uoRcCT7yKkpT0S+gkmwQlqobuLSyi3hN1CI0DYmdMrTPMHU3Mzd/XxmPdeWz6fTd mxm7MfbC35oX2oAb9u4n4B34/NOYiYnaqIbPkXqyDsN/Lj80O2Jhy8o4iqcc5LwisDnk 7aGmZTlOKa+c+sunOQuFS3HLkUXUR4CK1Wc9qw4tPPdruu7ucgyaavwItbdXe3CGlTVV +EoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NVZxBYjya/bVlEFKs7qigQ6ua4ofT68Gshv8z31H2EM=; b=PAkpHf5/TDx3QBMsDdPIErm564v16M5ePglOSet38NiaRrgthmH17gwMh8oKCiAhnH 0ZPHypND24fWWGSlDaL4y0Sw9cu+3ZMK6Fviqq5QJar8Kqug9zLPVYbctWZAYhrUCqkh 5xAvC66G9W4EGICQNsdzH02J3u+ykicPjEtNP2/yTXIz/ySKZakHpm8gSyJiGvZq3A8W bHp7wJZgSHRojz4ZxWZTGy3evMwaR/N40/s+9yeAa9qgDHryieHQtuW1bpIjiKqj0caY J8y324Bpet3qx5ZTRY/wrv1iQ7fFHGEl/2q6Lv+ofBh3spIzS9nOmdtbdVrwkYC83lqA 3EmQ== X-Gm-Message-State: AOAM530xCnCcJyIPaAo6rRcICRXdhEdp61DVq8+wpuTXXkS1ctqC/Phz hHB5EE7REJKHi4MtGjXLY674H2MecBzAJw== X-Received: by 2002:a17:90b:3b4b:b0:1bf:d4e:d677 with SMTP id ot11-20020a17090b3b4b00b001bf0d4ed677mr5261181pjb.56.1646341202596; Thu, 03 Mar 2022 13:00:02 -0800 (PST) Received: from localhost.localdomain (2603-800c-1201-c600-119c-490c-a4ee-08e8.res6.spectrum.com. [2603:800c:1201:c600:119c:490c:a4ee:8e8]) by smtp.gmail.com with ESMTPSA id t8-20020a6549c8000000b00372eb3a7fb3sm2729934pgs.92.2022.03.03.13.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 13:00:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/30] tcg/i386: Implement avx512 scalar shift Date: Thu, 3 Mar 2022 10:59:24 -1000 Message-Id: <20220303205944.469445-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303205944.469445-1-richard.henderson@linaro.org> References: <20220303205944.469445-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" AVX512VL has VPSRAQ. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 055db88422..1ef34f0b52 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -369,6 +369,7 @@ static bool tcg_target_const_match(int64_t val, TCGType type, int ct) #define OPC_PSLLQ (0xf3 | P_EXT | P_DATA16) #define OPC_PSRAW (0xe1 | P_EXT | P_DATA16) #define OPC_PSRAD (0xe2 | P_EXT | P_DATA16) +#define OPC_VPSRAQ (0x72 | P_EXT | P_DATA16 | P_VEXW | P_EVEX) #define OPC_PSRLW (0xd1 | P_EXT | P_DATA16) #define OPC_PSRLD (0xd2 | P_EXT | P_DATA16) #define OPC_PSRLQ (0xd3 | P_EXT | P_DATA16) @@ -2854,7 +2855,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, OPC_UD2, OPC_PSRLW, OPC_PSRLD, OPC_PSRLQ }; static int const sars_insn[4] = { - OPC_UD2, OPC_PSRAW, OPC_PSRAD, OPC_UD2 + OPC_UD2, OPC_PSRAW, OPC_PSRAD, OPC_VPSRAQ }; static int const abs_insn[4] = { /* TODO: AVX512 adds support for MO_64. */ @@ -3330,7 +3331,14 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_shrs_vec: return vece >= MO_16; case INDEX_op_sars_vec: - return vece >= MO_16 && vece <= MO_32; + switch (vece) { + case MO_16: + case MO_32: + return 1; + case MO_64: + return have_avx512vl; + } + return 0; case INDEX_op_rotls_vec: return vece >= MO_16 ? -1 : 0;