[LC++]floating processing of gcc

Ray hong ryhong at hotmail.com
Wed Mar 27 02:09:04 UTC 2002


Dear Sir or Mada,

Thank you very much for your kind suggestion.

>Well, for my little experience, optimizing FORTRAN is a different
>matter than optimizing C code (incidentally generated by a FORTRAN-to-C 
>translator): the former should be easier to optimize (or, at least, 
>producing optimized code from FORTRAN should be a better understood problem 
>than producing optimized code from C).
>
>But be sure to have a look at the optimizing options available for gcc
>(i.e. even with -O3 it doesn't always unroll loops unless you tell it
>explicitly).

Actually, I already used the -O3 during compiling.
The g77 was used in compiling the fortran source code,
and f2c and gcc were also used, and the computational
speed is comparable (but much slow than other compilers,
say, absoft fortran)

>I'd say that you have basically four choices:
>
>1) Stick to FORTRAN, and buy a proprietary compiler targeted to the
>platform of you choice.
>
>This already gave you very good results, from what you said.

Those commercial compilers are too expensive.

>2) Port the FORTRAN code to C by hand, without using an automatic
>translator (which probably doesn't generate very good C), and buy a
>proprietary C compiler targeted to the platform of your choice.
>
>This should give equally good results as (1), but with more effort,
>and you end buying a proprietary compiler anyways.

Not only the "g77 (or f77)" (and "f2c + gcc") are slow but also

the gcc is slow.

>3) Port the FORTRAN code to C and use gcc, optimizing the code by hand  
>where needed using inline assembly.

>This is the solution used for the Linux kernel: it works, but
>requires a lot of effort and knowledge.

Good idea.


>3bis) Port the FORTRAN code to C, and use GNU GMP
>(http://swox.com/gmp/#DOC) to do math. GMP functions are already
>optimized by hand for several platforms, using inline
>assembly. YMMV.

Yes. But it seems not easy to use the GMP, right?

>4) Stay with f2c + gcc. It works, slowly, but it works.
<http://graphics.hotmail.com/emcrook.gif>

Thank you very much again.

Ray


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com
-------------- next part --------------
An embedded message was scrubbed...
From: unknown sender
Subject: no subject
Date: no date
Size: 38
Url: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20020327/715a747c/attachment.eml 


More information about the tuxCPProgramming mailing list