[{"id":1763256,"web_url":"http://patchwork.ozlabs.org/comment/1763256/","msgid":"<CAFiYyc3YR_k1tazvjNn9UE7BeKQgzumMoWwxL2bjsU4VvNMhOw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-05T11:39:26","subject":"Re: [9/9] Make bitsize_mode_for_mode return an opt_mode","submitter":{"id":1765,"url":"http://patchwork.ozlabs.org/api/people/1765/","name":"Richard Biener","email":"richard.guenther@gmail.com"},"content":"On Mon, Sep 4, 2017 at 1:43 PM, Richard Sandiford\n<richard.sandiford@linaro.org> wrote:\n> 2017-09-04  Richard Sandiford  <richard.sandiford@linaro.org>\n\nOk.\n\nRichard.\n\n> gcc/\n>         * machmode.h (bitwise_mode_for_mode): Return opt_mode.\n>         * stor-layout.c (bitwise_mode_for_mode): Likewise.\n>         (bitwise_type_for_mode): Update accordingly.\n>\n> Index: gcc/machmode.h\n> ===================================================================\n> --- gcc/machmode.h      2017-09-04 12:18:55.821333642 +0100\n> +++ gcc/machmode.h      2017-09-04 12:19:42.856108173 +0100\n> @@ -694,7 +694,7 @@ smallest_int_mode_for_size (unsigned int\n>  }\n>\n>  extern opt_scalar_int_mode int_mode_for_mode (machine_mode);\n> -extern machine_mode bitwise_mode_for_mode (machine_mode);\n> +extern opt_machine_mode bitwise_mode_for_mode (machine_mode);\n>  extern opt_machine_mode mode_for_vector (scalar_mode, unsigned);\n>  extern opt_machine_mode mode_for_int_vector (unsigned int, unsigned int);\n>\n> Index: gcc/stor-layout.c\n> ===================================================================\n> --- gcc/stor-layout.c   2017-09-04 12:19:01.144339518 +0100\n> +++ gcc/stor-layout.c   2017-09-04 12:19:42.856108173 +0100\n> @@ -404,10 +404,10 @@ int_mode_for_mode (machine_mode mode)\n>      }\n>  }\n>\n> -/* Find a mode that can be used for efficient bitwise operations on MODE.\n> -   Return BLKmode if no such mode exists.  */\n> +/* Find a mode that can be used for efficient bitwise operations on MODE,\n> +   if one exists.  */\n>\n> -machine_mode\n> +opt_machine_mode\n>  bitwise_mode_for_mode (machine_mode mode)\n>  {\n>    /* Quick exit if we already have a suitable mode.  */\n> @@ -445,7 +445,7 @@ bitwise_mode_for_mode (machine_mode mode\n>      }\n>\n>    /* Otherwise fall back on integers while honoring MAX_FIXED_MODE_SIZE.  */\n> -  return mode_for_size (bitsize, MODE_INT, true).else_blk ();\n> +  return mode_for_size (bitsize, MODE_INT, true);\n>  }\n>\n>  /* Find a type that can be used for efficient bitwise operations on MODE.\n> @@ -454,8 +454,7 @@ bitwise_mode_for_mode (machine_mode mode\n>  tree\n>  bitwise_type_for_mode (machine_mode mode)\n>  {\n> -  mode = bitwise_mode_for_mode (mode);\n> -  if (mode == BLKmode)\n> +  if (!bitwise_mode_for_mode (mode).exists (&mode))\n>      return NULL_TREE;\n>\n>    unsigned int inner_size = GET_MODE_UNIT_BITSIZE (mode);","headers":{"Return-Path":"<gcc-patches-return-461496-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461496-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"D9xSMkNL\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmlBD0Jh6z9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 21:39:46 +1000 (AEST)","(qmail 34149 invoked by alias); 5 Sep 2017 11:39:35 -0000","(qmail 29912 invoked by uid 89); 5 Sep 2017 11:39:34 -0000","from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com)\n\t(74.125.82.52) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 05 Sep 2017 11:39:29 +0000","by mail-wm0-f52.google.com with SMTP id u26so17896604wma.0 for\n\t<gcc-patches@gcc.gnu.org>; Tue, 05 Sep 2017 04:39:28 -0700 (PDT)","by 10.80.180.205 with HTTP; Tue, 5 Sep 2017 04:39:26 -0700 (PDT)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:in-reply-to:references:from:date:message-id\n\t:subject:to:content-type; q=dns; s=default; b=qGXG1b8SW5ka5iYbrW\n\trPoY+NEyAvwLvY2CdAXZJKqqLqQBNngTN+JhIl/o37ecaF+m5rt7ZRcJpV/VgfJw\n\tL6Sr5ql3cfRnB/lsdcfvNPFuIKlVxeSAucKDp6+CeNuZAPj3hgW0xU0u1poJlKHc\n\tvU2j+RDgoYNfKOIK1Rxkjq5jQ=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:in-reply-to:references:from:date:message-id\n\t:subject:to:content-type; s=default; bh=TKpP6bC2JlHWcIPKyZYJau2e\n\tI8I=; b=D9xSMkNLhdQomKBFK7R4C7XuMAUi0mff2aZrASaIBaI+HYSt96yCwr0l\n\tQ7QQ2v3jFxETRZ8fRtTX5/J42kcmvA6Q7ZOYLdjACRpHiy9nVCmY2z/wqDFHuhVV\n\tHb38SrTA0FtwNfPsXPSLSLToCgCCQcENje7xLF1iWAsBUtMsgPo=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-9.8 required=5.0 tests=AWL, BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=","X-HELO":"mail-wm0-f52.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to;\n\tbh=R+v4HxEib3rm7OM6h2v1vOChyOVqtLXGAa0bZZr1glA=;\n\tb=JHbgyKF3X6np5SsI/n0CZ3/kiQTRys57rySQaOFyuL8PIiIFz7P3dPRln9hyi/tPJ3\n\tYaX64YmoewOSnkAjJ1L4UiMU4Gr3MCRbhIOvVc2CJt7x12NOPa9ODTq0lcbTjfw67zqy\n\tYL84+pPMl+ZK7+WPULtvrBOqtmLNJuaYLBVvItqnaSszxuOHk/3Va/j6J0+aEG+gJFKO\n\taBFqhwqTwKbGgf6JevO3lJJ4WkAPtI/Ll9aYwtSH+rirxEtOQwkng8dP22/YTjhTfVll\n\tP9lK5RiD5dkFRIYmvsnQbUSX64Ukox5DEW2qVC89KsMon8MjnkzNT1GDLUIyZ3PsfIyq\n\tKK6w==","X-Gm-Message-State":"AHPjjUgrdqqjii6HkshZAnzFIKc1vQrUNbt+Bnm4vwf0elmtTeHIsX/C\tDj5o1fI5ZMtsVDGsI1VXmhtUKasN969G","X-Google-Smtp-Source":"ADKCNb4mLTCUEj5BcbYRUF7bjyyd2g+bjLUY/J8c45oOiZEAnCyqsFr2uIGwVoG7lyk03WQw8oyEIB6fhOQXMtkOzNg=","X-Received":"by 10.80.136.24 with SMTP id b24mr3045092edb.246.1504611566782;\n\tTue, 05 Sep 2017 04:39:26 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<87pob6hep8.fsf@linaro.org>","References":"<87tw0iiu51.fsf@linaro.org> <87pob6hep8.fsf@linaro.org>","From":"Richard Biener <richard.guenther@gmail.com>","Date":"Tue, 5 Sep 2017 13:39:26 +0200","Message-ID":"<CAFiYyc3YR_k1tazvjNn9UE7BeKQgzumMoWwxL2bjsU4VvNMhOw@mail.gmail.com>","Subject":"Re: [9/9] Make bitsize_mode_for_mode return an opt_mode","To":"GCC Patches <gcc-patches@gcc.gnu.org>,\n\tRichard Sandiford <richard.sandiford@linaro.org>","Content-Type":"text/plain; charset=\"UTF-8\"","X-IsSubscribed":"yes"}}]