This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH] MIPS: IEEE 754-2008 NaN encoding support

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/{,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 

>  /* 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]