[PATCH][BZ #3268] Add fma single/double implementations to soft-fp
Jakub Jelinek
jakub@redhat.com
Fri Oct 13 10:26:00 GMT 2006
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
More information about the Libc-alpha
mailing list