From patchwork Thu Mar 26 23:26:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 1262463 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=V62dE7se; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48pLjc1f1Qz9sSw for ; Fri, 27 Mar 2020 10:26:58 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D2D0385E016; Thu, 26 Mar 2020 23:26:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D2D0385E016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585265215; bh=NAJNKvIkEsr8TvtqpaFA6NY55GuxDeqU02wA2arGzqo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=V62dE7seoAbbbVikYP6Cs7xmGHjmGIJAay/SOiV5aWmDLtW9gtWOtT5Zec6d4X9HH Sr7XC0onTUm+9Unl/WAYwuUnARJvfKEZdswcRAr04eY5fp6OrAOPiGVfILSnPOkw1i FOClLQZwyOrcZbMIhUOZ1dduLtoRcrXV9gB+yQog= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by sourceware.org (Postfix) with ESMTP id A0B58385E006 for ; Thu, 26 Mar 2020 23:26:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A0B58385E006 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-396-qjQSR_hnMDu0Q9so6JMH8Q-1; Thu, 26 Mar 2020 19:26:49 -0400 X-MC-Unique: qjQSR_hnMDu0Q9so6JMH8Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0135513F5; Thu, 26 Mar 2020 23:26:48 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8002160BF3; Thu, 26 Mar 2020 23:26:46 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 02QNQi1r004474; Fri, 27 Mar 2020 00:26:44 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 02QNQgQH003919; Fri, 27 Mar 2020 00:26:42 +0100 Date: Fri, 27 Mar 2020 00:26:42 +0100 To: Jeff Law Subject: [PATCH v2] Fix vextract* masked patterns (PR target/93069) Message-ID: <20200326232642.GO2156@tucnak> References: <20191229234622.GT10088@tucnak> <731c62e8ea300044f080af54e2cd02240625b477.camel@redhat.com> MIME-Version: 1.0 In-Reply-To: <731c62e8ea300044f080af54e2cd02240625b477.camel@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-22.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: Jakub Jelinek Cc: Uros Bizjak , gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" On Wed, Mar 25, 2020 at 05:59:36PM -0600, Jeff Law via Gcc-patches wrote: > Sorry. I know you asked me to look at this eons ago, but ever time I just get > lost. > > I get the distinct impression that we could do something much simpler (the patch > you initially proposed for backporting to the release branches). Perhaps we go > with that now and the full patch for gcc-11? So like this? Bootstrapped/regtested on x86_64-linux and i686-linux. 2020-03-26 Jakub Jelinek PR target/93069 * config/i386/sse.md (vec_extract_lo_): Use instead of m in output operand constraint. (vec_extract_hi_): Use instead of %{%3%}. * gcc.target/i386/avx512vl-pr93069.c: New test. * gcc.dg/vect/pr93069.c: New test. Jakub --- gcc/config/i386/sse.md.jj 2019-12-27 18:16:48.146431083 +0100 +++ gcc/config/i386/sse.md 2019-12-28 14:43:29.181456611 +0100 @@ -8782,7 +8782,8 @@ }) (define_insn "vec_extract_lo_" - [(set (match_operand: 0 "nonimmediate_operand" "=v,v,m") + [(set (match_operand: 0 "" + "=v,v,") (vec_select: (match_operand:V16FI 1 "" "v,,v") @@ -8834,7 +8835,8 @@ }) (define_insn "vec_extract_lo_" - [(set (match_operand: 0 "" "=v,v,m") + [(set (match_operand: 0 "" + "=v,v,") (vec_select: (match_operand:VI8F_256 1 "" "v,,v") @@ -8844,7 +8846,7 @@ && ( || !(MEM_P (operands[0]) && MEM_P (operands[1])))" { if () - return "vextract64x2\t{$0x0, %1, %0%{%3%}|%0%{%3%}, %1, 0x0}"; + return "vextract64x2\t{$0x0, %1, %0|%0, %1, 0x0}"; else return "#"; } --- gcc/testsuite/gcc.target/i386/avx512vl-pr93069.c.jj 2019-12-28 16:31:30.118695074 +0100 +++ gcc/testsuite/gcc.target/i386/avx512vl-pr93069.c 2019-12-28 16:32:16.920990539 +0100 @@ -0,0 +1,12 @@ +/* PR target/93069 */ +/* { dg-do assemble { target vect_simd_clones } } */ +/* { dg-options "-O2 -fopenmp-simd -mtune=skylake-avx512" } */ +/* { dg-additional-options "-mavx512vl" { target avx512vl } } */ +/* { dg-additional-options "-mavx512dq" { target avx512dq } } */ + +#pragma omp declare simd +int +foo (int x, int y) +{ + return x == 0 ? x : y; +} --- gcc/testsuite/gcc.dg/vect/pr93069.c.jj 2019-12-28 16:31:01.822121036 +0100 +++ gcc/testsuite/gcc.dg/vect/pr93069.c 2019-12-28 16:30:35.503517205 +0100 @@ -0,0 +1,10 @@ +/* PR target/93069 */ +/* { dg-do assemble { target vect_simd_clones } } */ +/* { dg-options "-O2 -fopenmp-simd" } */ + +#pragma omp declare simd +int +foo (int x, int y) +{ + return x == 0 ? x : y; +}