From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78087 invoked by alias); 30 Sep 2016 20:18:09 -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 78073 invoked by uid 89); 30 Sep 2016 20:18:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_00,MEDICAL_SUBJECT,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=cleanups 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; Fri, 30 Sep 2016 20:17:58 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47209793D8; Fri, 30 Sep 2016 20:17:56 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8UKHr1J002707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 30 Sep 2016 16:17:55 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u8UKHpVO016499; Fri, 30 Sep 2016 22:17:52 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u8UKHo5b016498; Fri, 30 Sep 2016 22:17:50 +0200 Date: Fri, 30 Sep 2016 21:31:00 -0000 From: Jakub Jelinek To: Uros Bizjak , Kirill Yukhin , Marek Polacek Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] FALLTHRU markers for sse.md and some cleanups Message-ID: <20160930201750.GI7282@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160927164726.GG3223@redhat.com> <87bmz9xj7w.fsf@mid.deneb.enyo.de> <20160927191847.GJ3223@redhat.com> <874m51xhtl.fsf@mid.deneb.enyo.de> <20160927195820.GE7282@tucnak.redhat.com> <20160929162113.GU3223@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160929162113.GU3223@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg02430.txt.bz2 On Thu, Sep 29, 2016 at 06:21:13PM +0200, Marek Polacek wrote: > On Tue, Sep 27, 2016 at 09:58:20PM +0200, Jakub Jelinek wrote: > > On Tue, Sep 27, 2016 at 09:29:10PM +0200, Florian Weimer wrote: > > > Not sure if I read this code correctly, but if we fall through from > > > V32HImode, and we have TARGET_SSE2 set, we execute this code: > > > > > > tmp = "p"; > > > ssesuffix = TARGET_AVX512VL ? "q" : ""; > > > > > > And not gcc_unreachable (), as is probably intended. > > > > It really doesn't matter. > > The instruction uses > > (define_mode_iterator VI12_AVX_AVX512F > > [ (V64QI "TARGET_AVX512F") (V32QI "TARGET_AVX") V16QI > > (V32HI "TARGET_AVX512F") (V16HI "TARGET_AVX") V8HI]) > > iterator (and, after all, ix86_hard_regno_mode_ok should ensure the same), > > which means V64QI/V32HI will only show up for TARGET_AVX512F, V32QI/V16HI > > only for TARGET_AVX (which implies TARGET_SSE2), and the slightly > > nonsensical > > gcc_assert (TARGET_SSE2 || TARGET_AVX512VL); > > before the switch (the || TARGET_AVX512VL is pointless, because > > TARGET_AVX512VL implies TARGET_SSE2 as well as TARGET_AVX2). > > So, I'd go perhaps for (untested) following patch, first diff -up, followed > > by diff -upb: > > Looks good, are you going to test/commit it? Or should I? Here it is, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2016-09-30 Jakub Jelinek * config/i386/sse.md (): Add FALLTHRU comments. Simplify asserts, remove unnecessary conditions. Formatting fixes. (*3): Likewise. --- gcc/config/i386/sse.md.jj 2016-08-30 08:42:09.169067639 +0200 +++ gcc/config/i386/sse.md 2016-09-30 14:40:45.382959729 +0200 @@ -11393,41 +11393,40 @@ (define_insn " { case MODE_XI: gcc_assert (TARGET_AVX512F); + /* FALLTHRU */ case MODE_OI: - gcc_assert (TARGET_AVX2 || TARGET_AVX512VL); + gcc_assert (TARGET_AVX2); + /* FALLTHRU */ case MODE_TI: - gcc_assert (TARGET_SSE2 || TARGET_AVX512VL); + gcc_assert (TARGET_SSE2); switch (mode) - { - case V16SImode: - case V8DImode: - if (TARGET_AVX512F) - { - tmp = "p"; - break; - } - case V8SImode: - case V4DImode: - case V4SImode: - case V2DImode: - tmp = TARGET_AVX512VL ? "p" : "p"; - break; - default: - gcc_unreachable (); - } + { + case V16SImode: + case V8DImode: + tmp = "p"; + break; + case V8SImode: + case V4DImode: + case V4SImode: + case V2DImode: + tmp = TARGET_AVX512VL ? "p" : "p"; + break; + default: + gcc_unreachable (); + } break; - case MODE_V8SF: + case MODE_V8SF: gcc_assert (TARGET_AVX); - case MODE_V4SF: + case MODE_V4SF: gcc_assert (TARGET_SSE); gcc_assert (!); tmp = "ps"; break; - default: + default: gcc_unreachable (); - } + } switch (which_alternative) { @@ -11489,46 +11488,42 @@ (define_insn "*3" { case MODE_XI: gcc_assert (TARGET_AVX512F); + /* FALLTHRU */ case MODE_OI: - gcc_assert (TARGET_AVX2 || TARGET_AVX512VL); + gcc_assert (TARGET_AVX2); + /* FALLTHRU */ case MODE_TI: - gcc_assert (TARGET_SSE2 || TARGET_AVX512VL); + gcc_assert (TARGET_SSE2); switch (mode) - { - case V64QImode: - case V32HImode: - if (TARGET_AVX512F) - { - tmp = "p"; - ssesuffix = "q"; - break; - } - case V32QImode: - case V16HImode: - case V16QImode: - case V8HImode: - if (TARGET_AVX512VL || TARGET_AVX2 || TARGET_SSE2) - { - tmp = "p"; - ssesuffix = TARGET_AVX512VL ? "q" : ""; - break; - } - default: - gcc_unreachable (); - } + { + case V64QImode: + case V32HImode: + tmp = "p"; + ssesuffix = "q"; + break; + case V32QImode: + case V16HImode: + case V16QImode: + case V8HImode: + tmp = "p"; + ssesuffix = TARGET_AVX512VL ? "q" : ""; + break; + default: + gcc_unreachable (); + } break; - case MODE_V8SF: + case MODE_V8SF: gcc_assert (TARGET_AVX); - case MODE_V4SF: + case MODE_V4SF: gcc_assert (TARGET_SSE); tmp = "ps"; ssesuffix = ""; break; - default: + default: gcc_unreachable (); - } + } switch (which_alternative) { Jakub