From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45615 invoked by alias); 29 Nov 2017 08:24:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 45602 invoked by uid 89); 29 Nov 2017 08:24:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=att, Hx-languages-length:2506 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 08:24:48 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B920C693D6; Wed, 29 Nov 2017 08:24:46 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-77.ams2.redhat.com [10.36.116.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D0255D9C7; Wed, 29 Nov 2017 08:24: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 vAT8Ohig022403; Wed, 29 Nov 2017 09:24:43 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id vAT8OgxA022402; Wed, 29 Nov 2017 09:24:42 +0100 Date: Wed, 29 Nov 2017 08:35:00 -0000 From: Jakub Jelinek To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix vec_concatv2di pattern for SSE4 (PR target/80819) Message-ID: <20171129082442.GW2353@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02475.txt.bz2 Hi! Before r218303 we had just (=x,0,rm) alternative for SSE4 (no AVX), that change turned it into (=Yr,0,*rm) and (=*x,0,rm) alternatives, so that we avoid too many prefixes if possible. The latter alternative is fine, we want the *, because that is the point, Yr class is the subset of x registers that don't need the REX prefix. The * in the first alternative makes no sense, with it IRA is effectively forced to allocate the second vec_concat pseudo into NO_REGS - memory, and while postreload can fix it up afterwards, we end up with dead stores that nothing ever removes afterwards. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-11-29 Jakub Jelinek PR target/80819 * config/i386/sse.md (vec_concatv2di): Remove * from (=Yr,0,*rm) alternative. * gcc.target/i386/pr80819-1.c: New test. * gcc.target/i386/pr80819-2.c: New test. --- gcc/config/i386/sse.md.jj 2017-11-24 08:58:05.000000000 +0100 +++ gcc/config/i386/sse.md 2017-11-28 18:04:20.739396199 +0100 @@ -13915,7 +13915,7 @@ (define_insn "vec_concatv2di" (match_operand:DI 1 "nonimmediate_operand" " 0, 0,x ,Yv,r ,vm,?!*Yn,0,Yv,0,0,v") (match_operand:DI 2 "vector_move_operand" - "*rm,rm,rm,rm,C ,C ,C ,x,Yv,x,m,m")))] + " rm,rm,rm,rm,C ,C ,C ,x,Yv,x,m,m")))] "TARGET_SSE" "@ pinsrq\t{$1, %2, %0|%0, %2, 1} --- gcc/testsuite/gcc.target/i386/pr80819-1.c.jj 2017-11-28 18:11:09.452482042 +0100 +++ gcc/testsuite/gcc.target/i386/pr80819-1.c 2017-11-28 18:09:57.000000000 +0100 @@ -0,0 +1,13 @@ +/* PR target/80819 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -msse4 -mno-avx -mtune=haswell -masm=att" } */ + +typedef unsigned long long V __attribute__((vector_size (16))); + +V +foo (unsigned long long x, unsigned long long y) +{ + return (V) { x, y }; +} + +/* { dg-final { scan-assembler-not "movq\[ \t]*%rsi, \[-0-9]*\\(" } } */ --- gcc/testsuite/gcc.target/i386/pr80819-2.c.jj 2017-11-28 18:11:15.942404034 +0100 +++ gcc/testsuite/gcc.target/i386/pr80819-2.c 2017-11-28 18:11:21.915332239 +0100 @@ -0,0 +1,13 @@ +/* PR target/80819 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -msse4 -mno-avx -mtune=generic -masm=att" } */ + +typedef unsigned long long V __attribute__((vector_size (16))); + +V +foo (unsigned long long x, unsigned long long y) +{ + return (V) { x, y }; +} + +/* { dg-final { scan-assembler-not "movq\[ \t]*%rsi, \[-0-9]*\\(" } } */ Jakub