From patchwork Mon Sep 4 11:43:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 111553 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp4120412ybm; Mon, 4 Sep 2017 04:43:44 -0700 (PDT) X-Received: by 10.99.112.20 with SMTP id l20mr192661pgc.150.1504525424155; Mon, 04 Sep 2017 04:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504525424; cv=none; d=google.com; s=arc-20160816; b=p8oSxAAj9y3jaGkgFNrcALJuQCXP0JwMVL0jOc/rMQgkI365N5Gp2wvnUtJORKB2/B 7qUdMcTWmeiv4c8LGE19kdKbWJ3pPmPxkeroaRknE1ecBcq3dBERWdzq5uFV3mgOh/1v HBpgtPcANxV1cfcheGBfkg4+KXeS1Pen55k1WdJSQjzHJQcm/J/Z/1b/07bNcb+mEtx1 7kaiNTLWK5PJv+hQ8iaJqT+678/uE1NYQBjPnk4KuKijHk65/JEUzjVLEg99YSJTJ9ir kjEChUKNveHWPCm3nn1fifMLTM7RHPO3GPCv0PcJ1ZQdOfe4jpunT4lLzwgT8IHkO5P2 2KKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=I7RL62UbgUFU23I2ocsnCJai6bEzHUQV9W9TOdflPbo=; b=hKtFIHJctcDapr35BMpI5zkuj99u2+mC9ukpl/K1mZXgQypxZzgBI0Gj1mdvOCPTjF Sajn50xzfInWCRT0+VYV9bzpWcjjX/JKM5duCfpEuCIsGunukMIq0kHYuYdIkaJ+XPzy TxtEPnCzKzwqE6IsMLVSsjAcwGQW67yA3B4ezRY34gKCOX/C41d4YQPrLdS9nP0+vJmH n6ssn42gLUphwTWayJaC2GcE0RNXouy5nRlYRjrpCvIWi471IC/EoUgDovpMbj08Wof+ 9YSWSGvJkKid0dwG02cXniOJqFuQsCzB8VUzPJ3nK2BP8+nKURq7rx+vbZFd6MNZDGVq kM3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AnD2/AU+; spf=pass (google.com: domain of gcc-patches-return-461412-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-461412-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k2si4969448pgk.660.2017.09.04.04.43.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Sep 2017 04:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-461412-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AnD2/AU+; spf=pass (google.com: domain of gcc-patches-return-461412-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-461412-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=fNtrMw+SZegnd/SVeTLi0E2mJ8pjG WRjx/0ejIBO0f3wHmagqznCRYMrn8ktlx2bGKYSpEeTbbmQO2Hxz3sBjuTwd/zTZ k0ZuHcK9uyEZt+3e67mI7JThwEFUQ/pAdkCgQY4b2o0pYoZSNXWDOQmpPQalD3Eg Ld9AHBdSrluzUk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=sKUFVaHcOWmnOzQimyGRLC+ffp8=; b=AnD 2/AU+uMPBtYBdYBoAIgPrEwWulQUcQaO+FMxkh7S09czZ8YCM+DOaHKMLBTDGM8j rXC6uO0m2U0/X1uHR/q0S51371VhNeLSCSx9jFbE+NvdIbNTbNr2fp4FInK0njcp oDy3TrsmOWnPnAUCYYDPlLudUwy117Tc+ekL9tho= Received: (qmail 105146 invoked by alias); 4 Sep 2017 11:43:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 104030 invoked by uid 89); 4 Sep 2017 11:43:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Sep 2017 11:43:24 +0000 Received: by mail-wm0-f49.google.com with SMTP id v2so3377028wmf.0 for ; Mon, 04 Sep 2017 04:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=I7RL62UbgUFU23I2ocsnCJai6bEzHUQV9W9TOdflPbo=; b=rleffSncfX2VYt/jptCO4v+oBfFJMlQqiJtisxzR0PSfeFs0VjIVro32ff6RbQB3cx LOBd7hbJIFUhjSYQTGvyiwqgU6OVldXNxnB6PgHnH1NqgBqWJoIJoEZZ+CZOMQiusjoN U28LiR5YlzUvuKXvrAh7Rn59821OXRnQIYvK0gGgbCdDsqzOY0Qh6A8E+v2v2/nJSAhd ZLuxCqOGhR1x5RK6MQCp1DAKaayYmQtyThBTMR5y5ZTv8msgXl1Zc/U+DjxooQR6INFy 0S/OLeUnk6mNjdxoEa6eVgSSVpm4hboRIlP+f3FRNF3J3r/hq4PHsqjl1zA3tD/525Mq WKCQ== X-Gm-Message-State: AHPjjUiHUaB9n0NkNNaNzFzTrUez7Obpu0Jz+qkOP3UR3VsaGzBDmIfa hhGQkbPsx0setNtEHuJASw== X-Google-Smtp-Source: ADKCNb6MhV2kyNsaDAGBJeTeRP+CKcX57W1cz3zBaKpnxuj4EdB6/NzLy5CWsqsxVcmC3iazrYKbNA== X-Received: by 10.28.163.67 with SMTP id m64mr107707wme.69.1504525402191; Mon, 04 Sep 2017 04:43:22 -0700 (PDT) Received: from localhost (94.197.120.41.threembb.co.uk. [94.197.120.41]) by smtp.gmail.com with ESMTPSA id z136sm386497wmc.36.2017.09.04.04.43.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Sep 2017 04:43:21 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [9/9] Make bitsize_mode_for_mode return an opt_mode References: <87tw0iiu51.fsf@linaro.org> Date: Mon, 04 Sep 2017 12:43:15 +0100 In-Reply-To: <87tw0iiu51.fsf@linaro.org> (Richard Sandiford's message of "Mon, 04 Sep 2017 12:24:26 +0100") Message-ID: <87pob6hep8.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 2017-09-04 Richard Sandiford 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);