This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH] BZ#2423 Errors in long double (ldbl-128ibm) rounding functions in glibc-2.4


On Mon, Mar 06, 2006 at 03:10:41PM -0600, Steven Munroe wrote:

> diff -urN libc24-cvstip-20060302/sysdeps/powerpc/fpu/fenv_libc.h libc24/sysdeps/powerpc/fpu/fenv_libc.h
> --- libc24-cvstip-20060302/sysdeps/powerpc/fpu/fenv_libc.h	2001-07-05 23:56:02.000000000 -0500
> +++ libc24/sysdeps/powerpc/fpu/fenv_libc.h	2006-03-03 14:33:43.000000000 -0600
> @@ -1,5 +1,5 @@
>  /* Internal libc stuff for floating point environment routines.
> -   Copyright (C) 1997 Free Software Foundation, Inc.
> +   Copyright (C) 1997, 2006 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
>  
>     The GNU C Library is free software; you can redistribute it and/or
> @@ -54,6 +54,41 @@
>    unsigned int l[2];
>  } fenv_union_t;
>  
> +
> +static inline int
> +__fegetround (void)
> +{
> +  int result;
> +  asm ("mcrfs 7,7\n\t"
> +       "mfcr  %0" : "=r"(result) : : "cr7");
> +  return result & 3;
> +}
> +#define fegetround() __fegetround()

I'd say you want the above asm volatile.  See
http://sources.redhat.com/ml/libc-hacker/2006-02/msg00015.html

	Jakub


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