as: MIPS NaN Encodings

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