* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / arch / ppc / math-emu / fsqrt.c
blob60ab5d03fc7ebaea133c93f2d22a765af87cf585
1 /* $Id: fsqrt.c,v 1.1 1999/08/23 19:00:01 cort Exp $
2 */
4 #include <linux/types.h>
5 #include <linux/errno.h>
6 #include <asm/uaccess.h>
8 #include "soft-fp.h"
9 #include "double.h"
11 int
12 fsqrt(void *frD, void *frB)
14 FP_DECL_D(B);
15 FP_DECL_D(R);
16 int ret = 0;
18 #ifdef DEBUG
19 printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frB);
20 #endif
22 __FP_UNPACK_D(B, frB);
24 #ifdef DEBUG
25 printk("B: %ld %lu %lu %ld (%ld)\n", B_s, B_f1, B_f0, B_e, B_c);
26 #endif
28 if (B_s && B_c != FP_CLS_ZERO)
29 ret |= EFLAG_VXSQRT;
30 if (B_c == FP_CLS_NAN)
31 ret |= EFLAG_VXSNAN;
33 FP_SQRT_D(R, B);
35 #ifdef DEBUG
36 printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
37 #endif
39 return (ret | __FP_PACK_D(frD, R));