This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Gfortran didn't support ABS intrinsic?
- From: Tianwei <tianwei dot sheng at gmail dot com>
- To: "Steve Kargl" <sgk at troutmask dot apl dot washington dot edu>
- Cc: tprince at computer dot org, "GCC Fortran mailing list" <fortran at gcc dot gnu dot org>
- Date: Mon, 17 Nov 2008 15:53:58 +0800
- Subject: Re: Gfortran didn't support ABS intrinsic?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=B5vlyD21UsY1aGDWiDgaSQ0F5VwQS3MubdL0+6HfoPk=; b=QqfIpUb14ZdWsMlYzKHM+bhxQ8LqtbWmA9keAeathIWeuYJO0VweeoNVJBckuj/KPK X98oXSfrZ+ibdnfbZQWTN4SaTgbQgReP3u1TYHxNkmXGvOK95WFEN7pEcjG5CDkE/UQf 4keLjiejwEJ9qCrEKTHVp9T9Rs/MjzyOr744U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=rToqMqbEBKTe0ndQ78KV4Xey73ioqlm6AVWBf/HnQetcdF6yV+0fL6sykSzhwmczGT OU17m3ySHc2yJyNXYQJgmFq9iY9tcsesA7RPO6IU3gPzeIeyRrlJZXBNUVShklBDLAN7 x/fk9m5YYGfz3z7VO4EodYkDJmoKOzkFgP55k=
- References: <7618fe50811161945q14e35958w9a5c08301a5f3bff@mail.gmail.com> <4920F8BE.8080103@sbcglobal.net> <7618fe50811162122i7454397ei60fa74f65efcfd24@mail.gmail.com> <20081117060647.GA32513@troutmask.apl.washington.edu>
Hi, Steve,
thanks for your reply.
On Mon, Nov 17, 2008 at 2:06 PM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> On Mon, Nov 17, 2008 at 01:22:40PM +0800, Tianwei wrote:
>> Thanks, sorry for posting this to the wrong mail list. "-ffast-math"
>> works, I'm re-testing the whole lapack package.
>
> Beware -ffast-math may be named incorrectly. In many cases, it
> translates to -fwrong-math.
>
>> I'm not familiar with Fortran Language. I just found that Fortran
>> lapack perform better than C-lapack and Atlas lapack, but Gfortran
>> still has some performance gap compared with other fortran compiler.
>
> This assertation does not make sense. Atlas is an optimized
> implementation of the BLAS routines with only a few LAPACK
> routines. Combining a tuned ATLAS with the LAPACK code from
> netlib should give you very good performance.
>
I also suspect that. I just built ATLAS as the manual said, and mixed
the built library with the offical Lapack, then run the 78 testcase in
the offical Lapack package(under the TESTING directory), finally sum
up all the timing result. but i built the ATLAS with openf90 compiler,
i don't know if it's the problem, but as the Atlas's paper said, the
built compiler doesn't matter very much.
>> the test is "xlintstz" which is for double precison complex liner
>> equation. Other compiler all did this optimization by default, also
>> there is an intrinsic statement in the .f file:
>> zlange.f:
>> 83 * .. Intrinsic Functions ..
>> 84 INTRINSIC ABS, MAX, MIN, SQRT
>
> What's your point? gfortran correctly recognizes ABS as
> an intrinsic procedure. gfortran may call a library
> routine for CABS where it is expected that CABS correctly
> handles rounding/overflow issues.
>
My point is that why other compiler all set "-ffast-math" by default,
and the user don't have to specify "-ffast-math " to enable this
intrinsic. Maybe it's an unsafe optimizaiton, if this is the case,
other compiler shouldn't enable them at -O3 level by default.
Thanks.
Tianwei
> --
> Steve
>
--
Sheng, Tianwei
Inst. of High Performance Computing
Dept. of Computer Sci. & Tech.
Tsinghua Univ.