From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25541 invoked by alias); 21 Jun 2011 16:16:08 -0000 Received: (qmail 25516 invoked by uid 22791); 21 Jun 2011 16:16:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jun 2011 16:15:52 +0000 Received: (qmail 20509 invoked from network); 21 Jun 2011 16:15:51 -0000 Received: from unknown (HELO ?84.152.222.116?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Jun 2011 16:15:51 -0000 Message-ID: <4E00C3AC.2060902@codesourcery.com> Date: Tue, 21 Jun 2011 16:46:00 -0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Jakub Jelinek CC: Richard Henderson , GCC Patches Subject: Re: [PATCH] Fix __bultin_clrsb* (PR middle-end/49489) References: <4DF9FA9A.8040505@codesourcery.com> <4DFA2E85.2030601@redhat.com> <4DFFA1AE.7070405@codesourcery.com> <20110621161058.GJ16443@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20110621161058.GJ16443@tyan-ft48-01.lab.bos.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01609.txt.bz2 On 06/21/2011 06:10 PM, Jakub Jelinek wrote: > gcc.c-torture/execute/builtin-bitops-1.c fails on x86_64-linux, because > there is no SImode libcall, only DImode, and it was zero-extending instead > of sign-extending the argument, and not subtracting the mode difference > afterwards. So int foo (int x) { return __builtin_clrsb (x); } > expanded the same as > int foo (int x) { return __builtin_clrsbl ((unsigned) x); } > instead of the correct > int foo (int x) { return __builtin_clrsbl (x) - 32; } > > Fixed thusly, I've also added folding of constant arguments > during tree optimizations for it. > > Ok for trunk? Ok. > (fold_builtin_bitop): Fix masking for width > HOST_BITS_PER_WIDE_INT > and < 2 * HOST_BITS_PER_WIDE_INT. Optimize BUILT_IN_CLRSB*. Oh that's where the folders were hiding? I thought we didn't have any for this family of builtins. Bernd