File: /usr/src/linux/arch/ppc/math-emu/fsqrts.c

1     /*
2      * BK Id: SCCS/s.fsqrts.c 1.6 05/17/01 18:14:22 cort
3      */
4     #include <linux/types.h>
5     #include <linux/errno.h>
6     #include <asm/uaccess.h>
7     
8     #include "soft-fp.h"
9     #include "double.h"
10     #include "single.h"
11     
12     int
13     fsqrts(void *frD, void *frB)
14     {
15     	FP_DECL_D(B);
16     	FP_DECL_D(R);
17     	int ret = 0;
18     
19     #ifdef DEBUG
20     	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frB);
21     #endif
22     
23     	__FP_UNPACK_D(B, frB);
24     
25     #ifdef DEBUG
26     	printk("B: %ld %lu %lu %ld (%ld)\n", B_s, B_f1, B_f0, B_e, B_c);
27     #endif
28     
29     	if (B_s && B_c != FP_CLS_ZERO)
30     		ret |= EFLAG_VXSQRT;
31     	if (B_c == FP_CLS_NAN)
32     		ret |= EFLAG_VXSNAN;
33     
34     	FP_SQRT_D(R, B);
35     
36     #ifdef DEBUG
37     	printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
38     #endif
39     
40     	return (ret | __FP_PACK_DS(frD, R));
41     }
42