From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3899 invoked by alias); 28 Jul 2015 09:35:38 -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 3857 invoked by uid 89); 28 Jul 2015 09:35:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Jul 2015 09:35:34 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-14-RZoNuGgcQyi6mfEd1sKRpA-1; Tue, 28 Jul 2015 10:35:29 +0100 Received: from E105887 ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Jul 2015 10:35:28 +0100 From: "David Sherwood" To: "'Jeff Law'" Cc: References: <000001d0c856$892c9f50$9b85ddf0$@arm.com> <55B6655C.5090001@redhat.com> In-Reply-To: <55B6655C.5090001@redhat.com> Subject: RE: [PATCH][1/N] Change GET_MODE_INNER to always return a non-void mode Date: Tue, 28 Jul 2015 09:38:00 -0000 Message-ID: <000001d0c918$bad2ce40$30786ac0$@arm.com> MIME-Version: 1.0 X-MC-Unique: RZoNuGgcQyi6mfEd1sKRpA-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-07/txt/msg02335.txt.bz2 >=20 > On 07/27/2015 04:25 AM, David Sherwood wrote: > > Hi, > > > > Part 1 of this change is a clean-up. I have changed calls to GET_MODE_I= NNER (m) > > so that it returns m in cases where there is no inner mode. This simpli= fies some > > of the calling code by removing the need to check for VOIDmode and allo= ws > > calling it unconditionally. I also removed element_precision () as it w= as only > > called in one place and thought it neater to call GET_MODE_PRECISION ex= plicitly. > > > > Parts 2-4 will include further tidy-ups and optimisations based on [1/N= ]. > > > > Good to go? > > > > Regards, > > David Sherwood. > > > > 2015-07-17 David Sherwood > > > > gcc/ > > * config/arm/arm.c (neon_element_bits, neon_valid_immediate): = Call > > GET_MODE_INNER unconditionally. > > * config/spu/spu.c (arith_immediate_p): Likewise. > > * config/i386/i386.c (ix86_build_signbit_mask): Likewise. New= variable. > > * expmed.c (synth_mult): Remove check for VOIDmode result from > > GET_MODE_INNER. > > (expand_mult_const): Likewise. > > * fold-const.c (): Replace call to element_precision with call= to > > GET_MODE_PRECISION. > > * genmodes.c (emit_mode_inner_inline): Replace void_mode->name= with > > m->name. > > (emit_mode_inner): Likewise. > > * lto-streamer-out.c (lto_write_mode_table): Update GET_MODE_I= NNER > > result check. > > * machmode.h (GET_MODE_UNIT_SIZE): Simplify. > > (GET_MODE_UNIT_PRECISION): Likewise. > > * rtlanal.c (subreg_get_info): Call GET_MODE_INNER uncondition= ally. > > * simplify-rtx.c (simplify_immed_subreg): Likewise. > > * stor-layout.c (bitwise_type_for_mode): Update assert. > > (element_precision): Remove. > Somehow my brain kept translating INNER into NARROWER. Naturally I was > having considerable trouble seeing how the patch could be correct ;-) > Looking at insn-modes.h cleared things up quickly. >=20 > In a lot of ways this makes GET_INNER_MODE act more like > GET_MODE_NUNITS, which is probably good. >=20 > You need to update the comment for GET_MODE_INNER in machmode.h to > reflect the change in its return value for non-vector modes. Thanks for the quick response! Before I post a new patch, does this new comment seem ok? /* Where MODE represents a vector return the mode of the inner elements, otherwise just return MODE. */ Dave. >=20 > With that update, this patch is fine. >=20 > jeff