fsqrts.c 654 B

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