The IEEE 754 floating-point standard defines two types of not-a-number (NaN) data: “signalling” NaNs and “quiet” NaNs. The original version of the standard did not specify how these two types should be distinguished. Most implementations followed the i387 model, in which the first bit of the significand is set for quiet NaNs and clear for signalling NaNs. However, the original MIPS implementation assigned the opposite meaning to the bit, so that it was set for signalling NaNs and clear for quiet NaNs.
The 2008 revision of the standard formally suggested the i387 choice and as from Sep 2012 the current release of the MIPS architecture therefore optionally supports that form. Code that uses one NaN encoding would usually be incompatible with code that uses the other NaN encoding, so MIPS ELF objects have a flag (
) to record which encoding is being used.
Assembly files can use the
directive to select between the two encodings. ‘
’ says that the assembly file uses the IEEE 754-2008 encoding while ‘
’ says that the file uses the original MIPS encoding. If several
directives are given, the final setting is the one that is used.
The command-line options
can be used instead of ‘
’ and ‘
’ respectively. However, any
directive overrides the command-line setting.
’ is the default if no
option is given.
Note that gnu
does not produce NaNs itself and therefore these directives do not affect code generation. They simply control the setting of the
Traditional MIPS assemblers do not support these directives.