From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39883 invoked by alias); 18 Jan 2019 12:44:42 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 39873 invoked by uid 89); 18 Jan 2019 12:44:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1318 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Jan 2019 12:44:40 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1209A9F73B; Fri, 18 Jan 2019 12:44:39 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A166C60BE8; Fri, 18 Jan 2019 12:44:38 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x0ICiaTA000927; Fri, 18 Jan 2019 13:44:36 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x0ICiZXO000926; Fri, 18 Jan 2019 13:44:35 +0100 Date: Fri, 18 Jan 2019 12:44:00 -0000 From: Jakub Jelinek To: Alan Modra Cc: kamlesh kumar , gcc@gcc.gnu.org, Umesh Kalappa Subject: Re: RS6000 emitting sign extention for unsigned type Message-ID: <20190118124435.GR30353@tucnak> Reply-To: Jakub Jelinek References: <20190118123328.GD29797@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190118123328.GD29797@bubble.grove.modra.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00144.txt.bz2 On Fri, Jan 18, 2019 at 11:03:28PM +1030, Alan Modra wrote: > On Tue, Jan 15, 2019 at 04:48:27PM +0530, kamlesh kumar wrote: > > Hi all, > > > > Analysed it further and find out that > > function ' rs6000_promote_function_mode ' (rs6000.c) needs modifcation. > > """ > > static machine_mode > > rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, > > machine_mode mode, > > int *punsignedp ATTRIBUTE_UNUSED, > > const_tree, int) > > { > > PROMOTE_MODE (mode, *punsignedp, type); > > return mode; > > } > > """ > > Here, This function is promoting the mode but > > it is not even touching 'punsignedp' and it is always initialized to zero > > by default. > > So in all cases 'punsignedp' remain zero even if it is for unsigned type. > > which cause the sign extension to happen even for unsigned type. > > > > is there any way to set 'punsignedp' appropriately here. > > No. The call to promote_function_mode in emit_library_call_value_1 > does not pass type info (because it isn't available for libcalls). Yeah, all the callers of emit_library_call* would need to be changed to pass triplets rtx, machine_mode, int/bool /*unsignedp*/, instead of just rtx_mode_t pair or add a new set of emit_library_call* APIs that would take those triplets. Jakub