Change FPU round mode



Hi,

Here is my system specification.

Intel P4 Xeon
CentOS 5.3
Linux kernel 2.6.18-128.1.6.el5
gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)
[note: the gcc was configured to support Fortran]

The default x87 FPU rounding mode is `round to the nearest'.

Is there any Fortran command that I can use to change the rounding
mode to `round to 0'?

But if such a command is not available, I know how to change the
rounding mode using assembly instructions. Is there any way to inline
assembly code in Fortran code with the gfortran compiler?

Please feel free to provide pointer to locations where I can find more
information.

Thank you!
.



Relevant Pages

  • Re: rounding mode
    ... I don't know the default rounding mode for Octave/Matlab, ... What is the default rounding mode for Fortran 95? ... How can I find out the default rounding mode for the compiler I ... real:: eps ...
    (comp.lang.fortran)
  • Re: rounding mode
    ... for the string 'rounding mode' in the Fortran 95 standard didn't ... Most Fortran compilers accept the default rounding mode of the CPU. ... I don't think the Fortran standard makes this explicit. ...
    (comp.lang.fortran)
  • Re: rounding mode
    ... |for a piece of Fortran 95 code that I translated to Octave/Matlab. ... |What is the default rounding mode for Fortran 95? ... different characteristics of interpolation schemes; ... floating point models (e.g. Sun Studio Fortran changes its ...
    (comp.lang.fortran)
  • rounding mode
    ... I don't know the default rounding mode for Octave/Matlab, ... What is the default rounding mode for Fortran 95? ... How can I find out the default rounding mode for the compiler I ...
    (comp.lang.fortran)
  • Re: Beginning programming question
    ... There were lots of debates about the practicality of fortran in such applications, given the inefficiency of fortran-generated code, but the combination of the 3:1 or 4:1 reduction in coding effort of high-order languages compared to assembly coupled with the Moores-Law increase in computer power soon pushed assembly code to the margins. ... Where assembly code shone was that there was most often a machine instruction that was just perfect for the purpose at hand, and so one designed one's code around that often oddball instruction. ... No matter how good the optimizer, the compiler was not going to design and code your program for you. ...
    (rec.crafts.metalworking)