diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2013-07-12 15:58:15 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2013-07-12 15:58:15 +0000 |
commit | ba92f8875272b3d30872644d5305868ff4d047b8 (patch) | |
tree | 77c84c712c3409bc45868cdb86a58a00e95760fb /gas/doc | |
parent | 627e05482b7a540b8453a196d03e15cce03a4e40 (diff) | |
download | gdb-ba92f8875272b3d30872644d5305868ff4d047b8.zip gdb-ba92f8875272b3d30872644d5305868ff4d047b8.tar.gz gdb-ba92f8875272b3d30872644d5305868ff4d047b8.tar.bz2 |
include/elf/
* mips.h (EF_MIPS_NAN2008): New macro.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Handle
EF_MIPS_NAN2008.
(_bfd_mips_elf_print_private_bfd_data): Likewise.
binutils/
* readelf.c (get_machine_flags): Handle EF_MIPS_NAN2008.
gas/
* config/tc-mips.c (mips_flag_nan2008): New variable.
(options): Add OPTION_NAN enum value.
(md_longopts): Handle it.
(md_parse_option): Likewise.
(s_nan): New function.
(mips_elf_final_processing): Handle EF_MIPS_NAN2008.
(md_show_usage): Add -mnan.
* doc/as.texinfo (Overview): Add -mnan.
* doc/c-mips.texi (MIPS Opts): Document -mnan.
(MIPS NaN Encodings): New node. Document .nan directive.
(MIPS-Dependent): List the new node.
gas/testsuite/
* gas/mips/nan-2008-1.d: New test.
* gas/mips/nan-2008-2.d: New test.
* gas/mips/nan-2008-3.d: New test.
* gas/mips/nan-2008-4.d: New test.
* gas/mips/nan-legacy-1.d: New test.
* gas/mips/nan-legacy-2.d: New test.
* gas/mips/nan-legacy-3.d: New test.
* gas/mips/nan-legacy-4.d: New test.
* gas/mips/nan-legacy-5.d: New test.
* gas/mips/nan-error-1.l: New list test.
* gas/mips/nan-error-2.l: New list test.
* gas/mips/nan-2008-override.s: New test source.
* gas/mips/nan-2008.s: New test source.
* gas/mips/nan-legacy-override.s: New test source.
* gas/mips/nan-legacy.s: New test source.
* gas/mips/nan-error-1.s: New test source.
* gas/mips/nan-error-2.s: New test source.
* gas/mips/mips.exp: Run the new tests.
ld/testsuite/
* ld-mips-elf/nan-2008.d: New test.
* ld-mips-elf/nan-legacy.d: New test.
* ld-mips-elf/nan-mixed-1.d: New test.
* ld-mips-elf/nan-mixed-2.d: New test.
* ld-mips-elf/nan-2008.s: New test source.
* ld-mips-elf/nan-legacy.s: New test source.
Diffstat (limited to 'gas/doc')
-rw-r--r-- | gas/doc/as.texinfo | 5 | ||||
-rw-r--r-- | gas/doc/c-mips.texi | 52 |
2 files changed, 57 insertions, 0 deletions
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index d1e397f..a2771d7 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -402,6 +402,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}] [@b{-mips64}] [@b{-mips64r2}] [@b{-construct-floats}] [@b{-no-construct-floats}] + [@b{-mnan=@var{encoding}}] [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}] [@b{-mips16}] [@b{-no-mips16}] [@b{-mmicromips}] [@b{-mno-micromips}] @@ -1363,6 +1364,10 @@ The @samp{--relax-branch} option enables the relaxation of out-of-range branches. By default @samp{--no-relax-branch} is selected, causing any out-of-range branches to produce an error. +@item -mnan=@var{encoding} +Select between the IEEE 754-2008 (@option{-mnan=2008}) or the legacy +(@option{-mnan=legacy}) NaN encoding format. The latter is the default. + @cindex emulation @item --emulation=@var{name} This option was formerly used to switch between ELF and ECOFF output diff --git a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi index 741237a..8a25a76 100644 --- a/gas/doc/c-mips.texi +++ b/gas/doc/c-mips.texi @@ -30,6 +30,7 @@ Assembly Language Programming'' in the same work. * MIPS assembly options:: Directives to control code generation * MIPS autoextend:: Directives for extending MIPS 16 bit instructions * MIPS insn:: Directive to mark data as an instruction +* MIPS NaN Encodings:: Directives to record which NaN encoding is being used * MIPS Option Stack:: Directives to save and restore options * MIPS ASE Instruction Generation Overrides:: Directives to control generation of MIPS ASE instructions @@ -416,6 +417,16 @@ Also no MIPS16 branches are ever relaxed. By default @samp{--no-relax-branch} is selected, causing any out-of-range branches to produce an error. +@cindex @option{-mnan=} command line option, MIPS +@item -mnan=@var{encoding} +This option indicates whether the source code uses the IEEE 2008 +NaN encoding (@option{-mnan=2008}) or the original MIPS encoding +(@option{-mnan=legacy}). It is equivalent to adding a @code{.nan} +directive to the beginning of the source file. @xref{MIPS NaN Encodings}. + +@option{-mnan=legacy} is the default if no @option{-mnan} option or +@code{.nan} directive is used. + @item --trap @itemx --no-break @c FIXME! (1) reflect these options (next item too) in option summaries; @@ -722,6 +733,47 @@ baz: @end example +@node MIPS NaN Encodings +@section Directives to record which NaN encoding is being used + +@cindex MIPS IEEE 754 NaN data encoding selection +@cindex @code{.nan} directive, MIPS +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 (@code{EF_MIPS_NAN2008}) to record which +encoding is being used. + +Assembly files can use the @code{.nan} directive to select between the +two encodings. @samp{.nan 2008} says that the assembly file uses the +IEEE 754-2008 encoding while @samp{.nan legacy} says that the file uses +the original MIPS encoding. If several @code{.nan} directives are given, +the final setting is the one that is used. + +The command-line options @option{-mnan=legacy} and @option{-mnan=2008} +can be used instead of @samp{.nan legacy} and @samp{.nan 2008} +respectively. However, any @code{.nan} directive overrides the +command-line setting. + +@samp{.nan legacy} is the default if no @code{.nan} directive or +@option{-mnan} option is given. + +Note that @sc{gnu} @code{@value{AS}} does not produce NaNs itself and +therefore these directives do not affect code generation. They simply +control the setting of the @code{EF_MIPS_NAN2008} flag. + +Traditional MIPS assemblers do not support these directives. + @node MIPS Option Stack @section Directives to save and restore options |