From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5965 invoked by alias); 2 May 2014 22:43:26 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 5955 invoked by uid 89); 2 May 2014 22:43:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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, 02 May 2014 22:43:24 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s42Mh8k7013334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 May 2014 18:43:08 -0400 Received: from [10.3.113.56] (ovpn-113-56.phx2.redhat.com [10.3.113.56]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s42Mh7mI027576; Fri, 2 May 2014 18:43:08 -0400 Message-ID: <53641F7B.7080906@redhat.com> Date: Fri, 02 May 2014 22:43:00 -0000 From: "Carlos O'Donell" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Stefani Seibold , glibc-bugs@sourceware.org Subject: Re: [Bug libm] pow() function execution time increase by factor 4000 References: <1399063459.1910.33.camel@vger.seibold.net> In-Reply-To: <1399063459.1910.33.camel@vger.seibold.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00026.txt.bz2 On 05/02/2014 04:44 PM, Stefani Seibold wrote: > A pow(10.0, x) where x has the hex equivalent of 0xc022247c7a9c48f9l > needs 4000 times longer as x equal 0xc022247c7a9c4800l, which is nearly > the same value. > > This happens on x86_64 Linux. I have tested it with the current git tree > and GLIB 2.19, but the behavior can also reproduced on an old EGLIBC > 2.12 32 bit PowerPC Linux system. > > The origin the fdlibm pow() function does not show this performance > impact, but is nearly three times slower as the best case libm execution > time. The result of the function call are the same. > > As i figured out the value 0xc022247c7a9c48f9l run into the __slowpow() > branch, where 0xc022247c7a9c4800l does bypass this branch. > > A "perf stat -e instructions" show that the 0xc022247c7a9c48f9 value > needs round about 1505962 instructions, the 0xc022247c7a9c4800l needs > only 385 instructions. > > On the old PowerPC device the execution time is 1 us vs. 5000 us. > > This makes pow() not very useable in a realtime environment. > > Maybe the exp() has the same problem. > > - Stefani This is not the right place to report a bug. Please see: http://www.gnu.org/software/libc/bugs.html In addition what you're reporting is not a bug, but we can discuss this in the bug you open. Cheers, Carlos.