From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34149 invoked by alias); 5 Sep 2017 11:39:35 -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 29912 invoked by uid 89); 5 Sep 2017 11:39:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Sep 2017 11:39:29 +0000 Received: by mail-wm0-f52.google.com with SMTP id u26so17896604wma.0 for ; Tue, 05 Sep 2017 04:39:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=R+v4HxEib3rm7OM6h2v1vOChyOVqtLXGAa0bZZr1glA=; b=JHbgyKF3X6np5SsI/n0CZ3/kiQTRys57rySQaOFyuL8PIiIFz7P3dPRln9hyi/tPJ3 YaX64YmoewOSnkAjJ1L4UiMU4Gr3MCRbhIOvVc2CJt7x12NOPa9ODTq0lcbTjfw67zqy YL84+pPMl+ZK7+WPULtvrBOqtmLNJuaYLBVvItqnaSszxuOHk/3Va/j6J0+aEG+gJFKO aBFqhwqTwKbGgf6JevO3lJJ4WkAPtI/Ll9aYwtSH+rirxEtOQwkng8dP22/YTjhTfVll P9lK5RiD5dkFRIYmvsnQbUSX64Ukox5DEW2qVC89KsMon8MjnkzNT1GDLUIyZ3PsfIyq KK6w== X-Gm-Message-State: AHPjjUgrdqqjii6HkshZAnzFIKc1vQrUNbt+Bnm4vwf0elmtTeHIsX/C Dj5o1fI5ZMtsVDGsI1VXmhtUKasN969G X-Google-Smtp-Source: ADKCNb4mLTCUEj5BcbYRUF7bjyyd2g+bjLUY/J8c45oOiZEAnCyqsFr2uIGwVoG7lyk03WQw8oyEIB6fhOQXMtkOzNg= X-Received: by 10.80.136.24 with SMTP id b24mr3045092edb.246.1504611566782; Tue, 05 Sep 2017 04:39:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.180.205 with HTTP; Tue, 5 Sep 2017 04:39:26 -0700 (PDT) In-Reply-To: <87pob6hep8.fsf@linaro.org> References: <87tw0iiu51.fsf@linaro.org> <87pob6hep8.fsf@linaro.org> From: Richard Biener Date: Tue, 05 Sep 2017 11:39:00 -0000 Message-ID: Subject: Re: [9/9] Make bitsize_mode_for_mode return an opt_mode To: GCC Patches , Richard Sandiford Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00258.txt.bz2 On Mon, Sep 4, 2017 at 1:43 PM, Richard Sandiford wrote: > 2017-09-04 Richard Sandiford Ok. Richard. > gcc/ > * machmode.h (bitwise_mode_for_mode): Return opt_mode. > * stor-layout.c (bitwise_mode_for_mode): Likewise. > (bitwise_type_for_mode): Update accordingly. > > Index: gcc/machmode.h > =================================================================== > --- gcc/machmode.h 2017-09-04 12:18:55.821333642 +0100 > +++ gcc/machmode.h 2017-09-04 12:19:42.856108173 +0100 > @@ -694,7 +694,7 @@ smallest_int_mode_for_size (unsigned int > } > > extern opt_scalar_int_mode int_mode_for_mode (machine_mode); > -extern machine_mode bitwise_mode_for_mode (machine_mode); > +extern opt_machine_mode bitwise_mode_for_mode (machine_mode); > extern opt_machine_mode mode_for_vector (scalar_mode, unsigned); > extern opt_machine_mode mode_for_int_vector (unsigned int, unsigned int); > > Index: gcc/stor-layout.c > =================================================================== > --- gcc/stor-layout.c 2017-09-04 12:19:01.144339518 +0100 > +++ gcc/stor-layout.c 2017-09-04 12:19:42.856108173 +0100 > @@ -404,10 +404,10 @@ int_mode_for_mode (machine_mode mode) > } > } > > -/* Find a mode that can be used for efficient bitwise operations on MODE. > - Return BLKmode if no such mode exists. */ > +/* Find a mode that can be used for efficient bitwise operations on MODE, > + if one exists. */ > > -machine_mode > +opt_machine_mode > bitwise_mode_for_mode (machine_mode mode) > { > /* Quick exit if we already have a suitable mode. */ > @@ -445,7 +445,7 @@ bitwise_mode_for_mode (machine_mode mode > } > > /* Otherwise fall back on integers while honoring MAX_FIXED_MODE_SIZE. */ > - return mode_for_size (bitsize, MODE_INT, true).else_blk (); > + return mode_for_size (bitsize, MODE_INT, true); > } > > /* Find a type that can be used for efficient bitwise operations on MODE. > @@ -454,8 +454,7 @@ bitwise_mode_for_mode (machine_mode mode > tree > bitwise_type_for_mode (machine_mode mode) > { > - mode = bitwise_mode_for_mode (mode); > - if (mode == BLKmode) > + if (!bitwise_mode_for_mode (mode).exists (&mode)) > return NULL_TREE; > > unsigned int inner_size = GET_MODE_UNIT_BITSIZE (mode);