From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <> Received: from fx308.security-mail.net (smtpout30.security-mail.net [85.31.212.39]) by sourceware.org (Postfix) with ESMTPS id 273843857017 for ; Tue, 10 Aug 2021 09:08:48 +0000 (GMT) Authentication-Results: sourceware.org; dkim=permerror (bad message/signature format) Received: by fx308.security-mail.net (Postfix) id 4CC982385F3; Tue, 10 Aug 2021 11:08:46 +0200 (CEST) Date: Tue, 10 Aug 2021 11:08:46 +0200 (CEST) From: MAILER-DAEMON (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: gcc-patches@gcc.gnu.org Auto-Submitted: auto-replied MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="1A1F82385F1.1628586526/fx308.security-mail.net" Message-Id: <20210810090846.4CC982385F3@fx308.security-mail.net> X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, HTML_MESSAGE, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_LOW, SCC_10_SHORT_WORD_LINES, SCC_5_SHORT_WORD_LINES, SPF_HELO_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2021 09:08:58 -0000 This is a MIME-encapsulated message. --1A1F82385F1.1628586526/fx308.security-mail.net Content-Description: Notification Content-Type: text/plain; charset=us-ascii This is the mail system at host fx308.security-mail.net. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system : host zimbra2.kalray.eu[195.135.97.26] said: 550 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command) --1A1F82385F1.1628586526/fx308.security-mail.net Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; fx308.security-mail.net X-Postfix-Queue-ID: 1A1F82385F1 X-Postfix-Sender: rfc822; gcc-patches@gcc.gnu.org Arrival-Date: Tue, 10 Aug 2021 11:08:46 +0200 (CEST) Final-Recipient: rfc822; marc.poulhies@kalray.eu Original-Recipient: rfc822;marc.poulhies@kalray.eu Action: failed Status: 5.1.1 Remote-MTA: dns; zimbra2.kalray.eu Diagnostic-Code: smtp; 550 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table --1A1F82385F1.1628586526/fx308.security-mail.net Content-Description: Undelivered Message Content-Type: message/rfc822 Return-Path: Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) by fx308.security-mail.net (Postfix) with ESMTPS id D42ED2358F7 for ; Tue, 10 Aug 2021 10:55:34 +0200 (CEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7BAE43951C26 for ; Tue, 10 Aug 2021 08:55:33 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 3C52C3857017 for ; Tue, 10 Aug 2021 08:54:33 +0000 (GMT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-lGGHWMk7Mmee-2I4DF3j-g-1; Tue, 10 Aug 2021 04:54:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC51E801A92; Tue, 10 Aug 2021 08:54:28 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41275669F3; Tue, 10 Aug 2021 08:54:28 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 17A8sQUV1032868 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 10 Aug 2021 10:54:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 17A8sQbr1032867; Tue, 10 Aug 2021 10:54:26 +0200 X-Quarantine-ID: X-Virus-Scanned: E-securemail, by Secumail X-Spam-Status: No, score=-2.119 tagged_above=-1000 required=7.5 tests=[AB_ENVFROM_LONG_40=0.5, AB_LONG_SUBJ_30=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-1, DKIM_VALID_AU=-0.1, FSL_RCVD_EX_GT_5=1, FSL_RCVD_UT_GT_5=0.01, HEAD_NEWS=-0.5, MISSING_MID=0.14, MM_ENVFROM_BOUNCE=1, RCVD_IN_DNSWL_MED=-1.3, S_FROM_GREY_MINUS_2=-2, T_TVD_SUBJ_NUM_OBFU=0.01, T_TVD_SUBJ_NUM_OBFU2=0.01, T_TVD_SUBJ_NUM_OBFU3=0.01] autolearn=disabled Authentication-Results: fx308.security-mail.net (amavisd-new); dkim=pass (1024-bit key) header.d=gcc.gnu.org Secumail-id: DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BAE43951C26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1628585733; bh=tnyek6v834hehGPp3ARV+2EDUXrSMTJ2ol68+bSQjuk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=i5qsqYSia2Ih4Fl7jbQuASYGFaEA9D5VVE8hrnHttuFQbG2mILcFbC/79N+/rwP/l 5B+TXCMnXdzTyr19vWiliTOkh5XS7e56W06ZQwjq3UCNr2Fi//mVDE9hQnYvSSHYwW cP/ZyETb8IVuUKfreFAOgdsE0hw7t4qc73D7MHp8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3C52C3857017 X-MC-Unique: lGGHWMk7Mmee-2I4DF3j-g-1 Date: Tue, 10 Aug 2021 10:54:26 +0200 To: Hongtao Liu Subject: [PATCH] i386: Allow some V32HImode and V64QImode permutations even without AVX512BW [PR80355] Message-ID: <20210810085426.GJ2380545@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jakub Jelinek via Gcc-patches Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+marc.poulhies=kalray.eu@gcc.gnu.org Sender: Gcc-patches X-ALTERMIMEV2_in: done Content-Type: text/plain; charset=utf-8 Hi! When working on the PR, I've noticed we generate terrible code for V32HImode or V64QImode permutations for -mavx512f -mno-avx512bw. Generally we can't do much with such permutations, but since PR68655 we can handle at least some, those expressible using V16SImode or V8DImode permutations, but that wasn't reachable, because ix86_vectorize_vec_perm_const didn't even try, it said without TARGET_AVX512BW it can't do anything, and with it can do everything, no d.testing_p attempts. This patch makes it try it for TARGET_AVX512F && !TARGET_AVX512BW. The first hunk is to avoid ICE, expand_vec_perm_even_odd_1 asserts d->vmode isn't V32HImode because expand_vec_perm_1 for AVX512BW handles already all permutations, but when we let it through without !TARGET_AVX512BW, expand_vec_perm_1 doesn't handle it. If we want, that hunk can be dropped if we implement in expand_vec_perm_even_odd_1 and its helper the even permutation as vpmovdw + vpmovdw + vinserti64x4 and odd permutation as vpsrld $16 + vpsrld $16 + vpmovdw + vpmovdw + vinserti64x4. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-08-10 Jakub Jelinek PR target/80355 * config/i386/i386-expand.c (expand_vec_perm_even_odd): Return false for V32HImode if !TARGET_AVX512BW. (ix86_vectorize_vec_perm_const) : If !TARGET_AVX512BW and TARGET_AVX512F and d.testing_p, don't fail early, but actually check the permutation. * gcc.target/i386/avx512f-pr80355-2.c: New test. --- gcc/config/i386/i386-expand.c.jj 2021-08-05 10:26:15.589555028 +0200 +++ gcc/config/i386/i386-expand.c 2021-08-09 14:14:35.466268680 +0200 @@ -20337,6 +20337,11 @@ expand_vec_perm_even_odd (struct expand_ if (d->perm[i] != 2 * i + odd) return false; + if (d->vmode == E_V32HImode + && d->testing_p + && !TARGET_AVX512BW) + return false; + return expand_vec_perm_even_odd_1 (d, odd); } @@ -20877,16 +20882,16 @@ ix86_vectorize_vec_perm_const (machine_m return true; break; case E_V32HImode: - if (!TARGET_AVX512BW) + if (!TARGET_AVX512F) return false; - if (d.testing_p) + if (d.testing_p && TARGET_AVX512BW) /* All implementable with a single vperm[it]2 insn. */ return true; break; case E_V64QImode: - if (!TARGET_AVX512BW) + if (!TARGET_AVX512F) return false; - if (d.testing_p) + if (d.testing_p && TARGET_AVX512BW) /* Implementable with 2 vperm[it]2, 2 vpshufb and 1 or insn. */ return true; break; --- gcc/testsuite/gcc.target/i386/avx512f-pr80355-2.c.jj 2021-08-09 14:24:27.176142589 +0200 +++ gcc/testsuite/gcc.target/i386/avx512f-pr80355-2.c 2021-08-09 14:29:23.308074276 +0200 @@ -0,0 +1,23 @@ +/* PR target/80355 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512f -mno-avx512vl -mno-avx512dq -mno-avx512bw" } */ +/* { dg-final { scan-assembler-times "\tvshufi(?:32x4|64x2)\t" 2 } } */ + +typedef short V __attribute__((vector_size (64))); +typedef char W __attribute__((vector_size (64))); + +W +f0 (W x) +{ + return __builtin_shuffle (x, (W) { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }); +} + +V +f1 (V x) +{ + return __builtin_shuffle (x, (V) { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }); +} Jakub To declare a filtering error, please use the following link : https://www.security-mail.net/reporter.php?mid=bf1d.61123f06.99556.0&r=marc.poulhies%40kalray.eu&s=gcc-patches-bounces%2Bmarc.poulhies%3Dkalray.eu%40gcc.gnu.org&o=%5BPATCH%5D+i386%3A+Allow+some+V32HImode+and+V64QImode+permutations+even+without+AVX512BW+%5BPR80355%5D&verdict=C&c=454b4fd04703e9c385a54af0fdd95c58945fbb66 --1A1F82385F1.1628586526/fx308.security-mail.net--