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 #3268] Add fma single/double implementations to soft-fp


On Thu, Oct 12, 2006 at 11:47:06AM -0500, Steven Munroe wrote:
> --- libc25-cvstip-20061005/soft-fp/fmadf4.c	Wed Dec 31 18:00:00 1969
> +++ libc24/soft-fp/fmadf4.c	Tue Oct 10 09:54:48 2006
...
> +#include "soft-fp.h"
> +#include "double.h"
> +#include "quad.h"
...
> +    long double u, x, y, z;
...
> +    FP_PACK_RAW_Q(x,X);
> +    FP_PACK_RAW_Q(y,Y);
> +    FP_PACK_RAW_Q(z,Z);
> +    FP_HANDLE_EXCEPTIONS;
> +
> +    /* Multiply.
> +       Rounding is not an issue as we keep the full 106 bit product.  */
> +    FP_UNPACK_Q(X,x);
> +    FP_UNPACK_Q(Y,y);
> +    FP_MUL_Q(U,X,Y);
> +    FP_PACK_Q(u,U);
> +    FP_HANDLE_EXCEPTIONS;
> +
> +    /* Add without rounding.  */
> +    FP_UNPACK_SEMIRAW_Q(U,u);

This isn't generic enough, not all targets have quad long double.
While in software it is possible to have IEEE quad support, when the
C long double type is shorter, such value should never go into that type.
So, I think you need to use _FP_PACK_CANONICAL/_FP_UNPACK_CANONICAL
instead (which AFAIK does everything you need here).  Also, comments
about 106 bits aren't appropriate even for IEEE quad.

	Jakub


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