[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2137.0. "/instruction_set=[no]floating_point" by CSC32::V_HAVER () Fri Apr 04 1997 17:27

According to the User's manual and CC help:

    The /INSTRUCTION_SET=NOFLOATING_POINT qualifier suppresses the
    generation of floating point instructions for integer operations.
    The default is /INSTRUCTION_SET=FLOATING_POINT.

I can't find much more on this qualifier.  According to the Alpha Architecture
manual, there is no integer division instruction.  So, I'm guessing an integer
is, by default, converted to floating point, and the floating point instructions
are used, unless you use this qualifier.  Are there other arithmetic operations
this qualifier affects?  How is the division, or whatever, done if the NOFLOAT
is used?

There are some bits and pieces of things in various notes, but I haven't
located a definite explanation of why you would use this qualifier.  Would
you take a performance hit by doing so?  

Could someone point me to a note, or other source for more info?  

Thanks,

Vicky H.
T.RTitleUserPersonal
Name
DateLines
2137.1GEMEVN::GLOSSOPOnly the paranoid surviveFri Apr 04 1997 18:2823
No, division is not done using floating point by default.  (In fact,
at this particular moment, integer division is *never* done using floating
point, though that could well change someday, particularly for 32b cases,
in which case this option would inhibit that transform.  Note that
the largest FP mantissa is 53 bits, which isn't sufficient for arbitrary
64b integer division...)

The most important things this does are:

    1) Turn on warnings whenever any FP instructions are generated.
       (This can be useful for detecting accidental introduction
       of FP code by the user.)

    2) Prevents the compiler from silently inserting floating point
       ops.  (For example, we could theoretically do memory copies
       using FP regs, but we don't today.)  One thing that does happen
       today is it shuts off use of floating point nops for aligning
       code in the instruction stream.  Another than can show up
       is use of certain types of floating point loads as prefetches.

The most typical use is for this today is compiling code for use in OS
kernels, etc., where the code may not be able to rely on the state
of the FPU.
2137.2More that you probably didn't want to know!STAR::DIPIRROMon Apr 07 1997 10:4911
    	Just to add to what Kent said, code in the OS is built this way for
    a couple of reasons. First, we avoid any floating point faults and
    having to handle them. Second, a process running on the system which
    has not used floating point does not need its floating point registers
    saved and restored during context switches. So context switching is
    faster. It would be kind of a lousy thing to do to a process if the OS
    itself used floating point instructions in the context of a process and
    slowed down the context switching of that process as a result. Now if
    the application running in that process is doing floating point stuff,
    that's a different matter. VMS tried to only do the save and restore of
    floating point registers when it has to during context switching.