public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: <libc-ports@sourceware.org>, <libc-alpha@sourceware.org>,
	Doug Gilmore	<Doug.Gilmore@imgtec.com>
Subject: Re: [RFC][PATCH] MIPS: IEEE 754-2008 NaN encoding support
Date: Fri, 23 Aug 2013 15:26:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1308231511370.22185@digraph.polyomino.org.uk> (raw)
In-Reply-To: <alpine.DEB.1.10.1308222343480.8514@tp.orcam.me.uk>

On Fri, 23 Aug 2013, Maciej W. Rozycki wrote:

>    Finally a new name has been defined for the dynamic linker so that 
>    2008-NaN and legacy-NaN binaries can coexist on a single system that 
>    supports dual-mode operation and that a legacy dynamic linker that 
>    does not support verifying the 2008-NaN ELF file header flag is not 
>    chosen to interpret a 2008-NaN binary by accident.

Adding a new name is the correct thing to do, but it means you need to 
update ports/sysdeps/unix/sysv/linux/mips/{configure.in,Makefile} to 
reflect that there are now twelve rather than six ABI variants that one or 
more generated installed header needs to reflect - as in ../arm/Makefile, 
you will need to set the *-ld-soname variables for each of the twelve 
ABIs, so that gnu/lib-names.h is correct for all the variants.

(gnu/lib-names.h will only depend on the NaN encoding in fact, 
bits/syscall.h only on whether the ABI is o32, n32 or n64, and gnu/stubs.h 
on both whether the ABI is o32, n32 or n64 and whether it's hard or soft 
float.  But the build system doesn't do anything special regarding headers 
depending only on a subset of ABI information like that; the twelve ABIs 
will just be treated as completely distinct for that purpose.)

> Index: glibc-fsf-trunk-quilt/ports/sysdeps/mips/fpu/fesetenv.c
> ===================================================================
> --- glibc-fsf-trunk-quilt.orig/ports/sysdeps/mips/fpu/fesetenv.c	2013-05-16 18:17:13.000000000 +0100
> +++ glibc-fsf-trunk-quilt/ports/sysdeps/mips/fpu/fesetenv.c	2013-08-22 10:32:05.447640501 +0100

I don't see why you need changes here.  If someone has somehow created an 
fenv_t value with an inappropriate NAN2008 bit, that's definitely outside 
the scope of what gives defined behavior - such values should only come 
from other functions such as fegetenv (or the standard values defined in 
fenv.h).

>  /* The fdlibm code requires strict IEEE double precision arithmetic,
>     and no interrupts for exceptions, rounding to nearest.  */
> -
> +#ifdef __mips_nan2008
> +#define _FPU_DEFAULT  0x00040000
> +#else
>  #define _FPU_DEFAULT  0x00000000
> +#endif
>  
> -/* IEEE:  same as above, but exceptions */
> +/* IEEE: same as above, but exceptions.  */
> +#ifdef __mips_nan2008
> +#define _FPU_IEEE     0x00040F80
> +#else
>  #define _FPU_IEEE     0x00000F80
> +#endif

"# define" indentation inside #if.

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2013-08-23 15:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 23:53 Maciej W. Rozycki
2013-08-23  0:58 ` Rich Felker
2013-08-23  1:41   ` Maciej W. Rozycki
2013-08-23  1:57     ` Rich Felker
2013-08-23  3:11       ` pinskia
2013-08-23  3:38         ` Rich Felker
2013-08-23  4:08           ` pinskia
2013-08-23  4:12             ` Rich Felker
2013-08-23  4:10     ` Rich Felker
2013-08-23  3:46 ` Rich Felker
2013-08-23 10:53   ` Maciej W. Rozycki
2013-08-23 15:26 ` Joseph S. Myers [this message]
2013-09-05 22:47   ` [RFC][PATCH v2] " Maciej W. Rozycki
2013-09-06 16:24     ` Joseph S. Myers
2013-09-10  9:36       ` Maciej W. Rozycki
2013-09-10 23:24         ` Joseph S. Myers
2013-09-16 15:14           ` [PATCH v3] " Maciej W. Rozycki
2013-09-16 15:26             ` Joseph S. Myers
2013-09-18 20:48               ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1308231511370.22185@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=Doug.Gilmore@imgtec.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    --cc=macro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).