From patchwork Mon Oct 23 17:37:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116839 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4901157qgn; Mon, 23 Oct 2017 10:38:04 -0700 (PDT) X-Received: by 10.99.116.18 with SMTP id p18mr12512538pgc.269.1508780284505; Mon, 23 Oct 2017 10:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508780284; cv=none; d=google.com; s=arc-20160816; b=oxkhOOnw8xmu/ta11hXDGBiQpl02i9MzMbPzw5HcelC/4qeNgSnYcmWm0c9cY+Nmqo 4bXNbcMhcb62GAD9/Hr+nOj+88CcmUjB7onr2xb3eTUfr5OD10osvzdRXxhmapFtCoC1 njrJrCCIgXKtiJbY0WOjBhVkAx72L3wbK3IGqOIoE+9DsvMSTZee07vi68sXJXpfw/WN x6DDvu+rk9LCZSpNZAFXLSDx8LCJNutar2Hh3prL+T14QqG6kjevPycMw+d5KeZKpp8F v0h6Gt+AiUPmfNAPifrxcIwL2PkmEDheg2FI5e30K9LQi1Wkl3+x828bpUMyFClYz18v S01g== 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=ES2e0yshM8A6KKXN61kkw6Ut5KobYfni+sBuoyW5QMc=; b=LghJCsOks/K6QeOl+EVwDBf4Dne+qHhSWhV668hTTkL7QHdVlMFhinvYaBYtco68wa zvJk9foB7yOmQIE/zwsPMbxDgOYffkfF1yQKrF+kfWPDStxBKuYwVX69v/DaaUQvEoNm njHAAwFH5x0I0tIytRnVdF+2274z5OCxHwI6LMJBMX0hvpxajVkLIrsZ+BQuIAiNItmx 6G4T0Iv6p16HhbTAGQlhQWln5qpAG4EaW9w5Ftjc61pJtPU5cfIYA8qauP+2yRWW3yBE 8kLuTG5czHk89k02jkc5mCEcFxDYkNund75M6E4Q8TXjiyvfEjOClF4ZKWHKrxRdY6go BOjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gHsrdzQr; spf=pass (google.com: domain of gcc-patches-return-464870-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464870-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 m37si4296946pla.464.2017.10.23.10.38.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:38:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464870-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=gHsrdzQr; spf=pass (google.com: domain of gcc-patches-return-464870-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464870-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=hjBmojeLU+xU/lfufiEObZLr/BRQ8 QEK1xV5sn3fcGU8lNENLM3yuNGhVjL3IfWTF6j6lKcqVinUsAPW+EuEch2jsFiv5 wqsBfYI+AhQ4uqIaDFsURNAOD29cqi/ED65MwrKp9q00q8pS0Gu/wAbNwwuaOl/B bTwaqmhSTRNxfg= 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=qRxq8849mtzbadWhx8LVi4jzsE0=; b=gHs rdzQrS4GiwnzGgWsNjkIq3abXf6bVTtuHGcqFJkZcEPQSE1F96Pbl2+2fMIPzltU 3tz3p2/9CKe4yNBRs/MlUsuZRUQ645iMQMy/kkJGOMYs7ZcohFbjOKt1KfbOyr5p tEKKS99llvl5+TmU4bhphzd0XuFCAitXHb2Ne0L4= Received: (qmail 95785 invoked by alias); 23 Oct 2017 17:37:50 -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 94348 invoked by uid 89); 23 Oct 2017 17:37:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Gm-Message-State:AMCzsaV X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:37:48 +0000 Received: by mail-wm0-f46.google.com with SMTP id m72so9380402wmc.0 for ; Mon, 23 Oct 2017 10:37:47 -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=ES2e0yshM8A6KKXN61kkw6Ut5KobYfni+sBuoyW5QMc=; b=lzLImFgBjwwBHg2o1/VgK2hfkoJni0LcQG1hSamu7DPcUeP1FEK1J1dVkhFceLbusa soDfYI17fXHtW0UQJ5xx2y5veqm+Z3ZUgWu2Hxol36of007YAdyVTZnx+avulmiXrpj5 VQDi04JrudSdJjbqt/zQBW3fiea/AWqUZjBqkOqjovKp1IjaK3WJGD1GqEIYxJiXf0cW louVgUN5dxpr2sUkJ7JtKTlFm0YQ0lctU11wGKc/2XwlP+sK+qoP7wPStnNgujtIud3W xefcvBvKy2I9nwxyoDpSeCkTEQidYNsatJb4cFKZZ4dsXJIVn5RXRvKHxu8xjmuQTMpk nQyg== X-Gm-Message-State: AMCzsaV+M4UfmBzTggwMiNdd4lMKTTHdNh3vFUqPW+SV8YqskKXBLeA+ mTXfd1dGOFbjlnkHwnu+gHmBmX4s96c= X-Google-Smtp-Source: ABhQp+SdK/qdsGWs8zkJodh+ca4idHBdQOPq6/VvPp75g63VgjEVWGERezzEPD6IhtbIcD2x3mPJ6Q== X-Received: by 10.28.131.131 with SMTP id f125mr5452248wmd.137.1508780266090; Mon, 23 Oct 2017 10:37:46 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id d129sm6715847wmf.34.2017.10.23.10.37.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:37:45 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [094/nnn] poly_int: expand_ifn_atomic_compare_exchange_into_call References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:37:44 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87inf5epef.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes the mode size assumptions in expand_ifn_atomic_compare_exchange_into_call a bit more explicit, so that a later patch can add a to_constant () call. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert that the mode size is in the set {1, 2, 4, 8, 16}. Index: gcc/builtins.c =================================================================== --- gcc/builtins.c 2017-10-23 17:22:18.226824652 +0100 +++ gcc/builtins.c 2017-10-23 17:25:41.647742640 +0100 @@ -5838,9 +5838,12 @@ expand_ifn_atomic_compare_exchange_into_ /* Skip the boolean weak parameter. */ for (z = 4; z < 6; z++) vec->quick_push (gimple_call_arg (call, z)); + /* At present we only have BUILT_IN_ATOMIC_COMPARE_EXCHANGE_{1,2,4,8,16}. */ + unsigned int bytes_log2 = exact_log2 (GET_MODE_SIZE (mode)); + gcc_assert (bytes_log2 < 5); built_in_function fncode = (built_in_function) ((int) BUILT_IN_ATOMIC_COMPARE_EXCHANGE_1 - + exact_log2 (GET_MODE_SIZE (mode))); + + bytes_log2); tree fndecl = builtin_decl_explicit (fncode); tree fn = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fndecl)), fndecl);