fpu.h 924 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * include/fpu.h
  3. *
  4. * This work was supported by the Director, Office of Science, Division
  5. * of Mathematical, Information, and Computational Sciences of the
  6. * U.S. Department of Energy under contract number DE-AC03-76SF00098.
  7. *
  8. * Copyright (c) 2001
  9. *
  10. * Contains functions to set and restore the round-to-double flag in the
  11. * control word of a x86 FPU. The algorithms in the double-double and
  12. * quad-double package does not function with the extended mode found in
  13. * these FPU.
  14. */
  15. #ifndef _QD_FPU_H
  16. #define _QD_FPU_H
  17. #include <qd/qd_config.h>
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /*
  22. * Set the round-to-double flag, and save the old control word in old_cw.
  23. * If old_cw is NULL, the old control word is not saved.
  24. */
  25. QD_API void fpu_fix_start(unsigned int *old_cw);
  26. /*
  27. * Restore the control word.
  28. */
  29. QD_API void fpu_fix_end(unsigned int *old_cw);
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif /* _QD_FPU_H */