From patchwork Mon Jun 22 19:44:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 487367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D47114010F for ; Tue, 23 Jun 2015 05:45:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=LuevpL+D; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=lddVsAv2K64xKl5EF 62lqjwZWsnMVlXSmKsMIFB8lI7LCoMpiu9aI7pzREujF00ceHrqw5Z8pSjBdkFAY yvUodkc0o9HEUiRW60l6EHYmtFf7/vW47iq7YOcY/8KA8eOlQ6eIw/mYO5Wipx0B 6Fofm1g55ZYL7gq9PI4gSG8Uu0= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=J84F4O0UQbTh4hEuL6lZ8LU 4wY4=; b=LuevpL+Dx3gogKwt4HPNXmZz+L95o54c56O+YfmPkwUTfSVjAcPM7Pa fsRZQeiR92qwBqW5mAUHcxkXG3cgOoYSPjANfQTAkz3smbZvaR+ygVOPokCmJ0Jd q76gaqzfCzsVjvduonx6U9XDb1OCYa2pou7JZAdj6ddmc9FX+XR4= Received: (qmail 67232 invoked by alias); 22 Jun 2015 19:45:02 -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 67161 invoked by uid 89); 22 Jun 2015 19:45:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_40, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Jun 2015 19:44:59 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1Z77eJ-0002Vu-O4 from Nathan_Sidwell@mentor.com ; Mon, 22 Jun 2015 12:44:55 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Mon, 22 Jun 2015 12:44:31 -0700 Message-ID: <5588659E.8050909@codesourcery.com> Date: Mon, 22 Jun 2015 15:44:30 -0400 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Marek Polacek CC: GCC Patches Subject: Re: [gomp4] Remove some ptxness from middle end References: <55883F43.2080604@codesourcery.com> <20150622170449.GL10139@redhat.com> In-Reply-To: <20150622170449.GL10139@redhat.com> On 06/22/15 13:04, Marek Polacek wrote: > On Mon, Jun 22, 2015 at 01:00:51PM -0400, Nathan Sidwell wrote: >> + if (GET_CODE (arg) != CONST_INT >> + || (unsigned HOST_WIDE_INT)INTVAL (arg) >= OACC_HWM) > > Don't we have UINTVAL for this? So UINTVAL (arg). Applied the attached, after testing. Also realized I'd missed some places I should have used the new loop level enumeration. nathan 2015-06-22 Nathan Sidwell * omp-low.c (expand_oacc_get_num_threads): Use OACC enum. (expand_oacc_get_thread_num, make_predication_test): Likewise. * builtins.c (expand_oacc_id): Use UINTVAL. Index: omp-low.c =================================================================== --- omp-low.c (revision 224747) +++ omp-low.c (working copy) @@ -4994,8 +4994,8 @@ expand_oacc_get_num_threads (gimple_seq tree decl = builtin_decl_explicit (BUILT_IN_GOACC_NID); unsigned ix; - for (ix = 0; (1 << ix) <= gwv_bits; ix++) - if ((1 << ix) & gwv_bits) + for (ix = OACC_gang; ix != OACC_HWM; ix++) + if (OACC_LOOP_MASK(ix) & gwv_bits) { tree arg = build_int_cst (unsigned_type_node, ix); tree count = create_tmp_var (unsigned_type_node); @@ -5022,8 +5022,8 @@ expand_oacc_get_thread_num (gimple_seq * unsigned ix; /* Start at gang level, and examine relevant dimension indices. */ - for (ix = 0; (1 << ix) <= gwv_bits; ix++) - if ((1 << ix) & gwv_bits) + for (ix = OACC_gang; ix != OACC_HWM; ix++) + if (OACC_LOOP_MASK (ix) & gwv_bits) { tree arg = build_int_cst (unsigned_type_node, ix); @@ -10671,7 +10671,7 @@ make_predication_test (edge true_edge, b unsigned ix; for (ix = OACC_worker; ix <= OACC_vector; ix++) - if (mask & (1 << ix)) + if (OACC_LOOP_MASK (ix) & mask) { gimple call = gimple_build_call (decl, 1, build_int_cst (unsigned_type_node, ix)); Index: builtins.c =================================================================== --- builtins.c (revision 224747) +++ builtins.c (working copy) @@ -5971,8 +5971,7 @@ expand_oacc_id (enum built_in_function f rtx arg; arg = expand_normal (arg0); - if (GET_CODE (arg) != CONST_INT - || (unsigned HOST_WIDE_INT)INTVAL (arg) >= OACC_HWM) + if (GET_CODE (arg) != CONST_INT || UINTVAL (arg) >= OACC_HWM) { error ("argument to %D must be constant in range 0 to %d", get_callee_fndecl (exp), OACC_HWM - 1);