- To: gcc-help@xxxxxxxxxxx
- Subject: Re: GCC's -ffast-math behavior
- From: Andrew Haley <aph@xxxxxxxxxx>
- Date: Thu, 09 Feb 2012 09:47:01 +0000
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329385651; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=m1xEesmNUEBSUIJ9cND/ 3ClVKUs=; b=iOWVyTWgFI9jujwOKpY4xhvCnwHhzYZ3cChKlKkiuGAvRi/QVP90 S9UE2Ap/A9JzyRZzzaJo+RcoC2E5wISzMzN7y4LQYzfdidM6DyByZW4BriSBF4AV eIUEf7ChFV8iyA9Kk2mQEdKirovYuIlYN+KF8Dga3gz2fB+wERhV8zo=
- In-reply-to: <4F339357.5020902@gmail.com>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16
On 02/09/2012 09:35 AM, xunxun wrote:
> 于 2012/2/9 17:21, Andrew Haley 写道:
>> On 02/09/2012 08:33 AM, xunxun wrote:
>>> When using -ffast-math, gcc don't generate the math function
>>> symbol: U _exp
>> No, it doesn't. Instead gcc uses the F2XM1 instruction. Why would
>> you want to call a library when gcc has an instruction to do the
>> job?
>>
> Because other math lib works faster than gcc itself (even with
> fastmath), and I want to use fastmath to make other caculation faster, too.
Hmm, I think that'll be difficult. We tend to assume that when a
processor has built-in instructions to do something, that's the
fastest way to do it. It's usually true, and I am wondering what
tricks Intel uses. Granted, the floating-point transcendental
instructions aren't super-fast, and perhaps Intel doesn't optimize
them any more.
Andrew.
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]