fpu.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _ASM_IA64_FPU_H
  2. #define _ASM_IA64_FPU_H
  3. /*
  4. * Copyright (C) 1998, 1999, 2002, 2003 Hewlett-Packard Co
  5. * David Mosberger-Tang <davidm@hpl.hp.com>
  6. */
  7. #include <linux/types.h>
  8. /* floating point status register: */
  9. #define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */
  10. #define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */
  11. #define FPSR_TRAP_ZD (1 << 2) /* zero-divide trap disabled */
  12. #define FPSR_TRAP_OD (1 << 3) /* overflow trap disabled */
  13. #define FPSR_TRAP_UD (1 << 4) /* underflow trap disabled */
  14. #define FPSR_TRAP_ID (1 << 5) /* inexact trap disabled */
  15. #define FPSR_S0(x) ((x) << 6)
  16. #define FPSR_S1(x) ((x) << 19)
  17. #define FPSR_S2(x) (__IA64_UL(x) << 32)
  18. #define FPSR_S3(x) (__IA64_UL(x) << 45)
  19. /* floating-point status field controls: */
  20. #define FPSF_FTZ (1 << 0) /* flush-to-zero */
  21. #define FPSF_WRE (1 << 1) /* widest-range exponent */
  22. #define FPSF_PC(x) (((x) & 0x3) << 2) /* precision control */
  23. #define FPSF_RC(x) (((x) & 0x3) << 4) /* rounding control */
  24. #define FPSF_TD (1 << 6) /* trap disabled */
  25. /* floating-point status field flags: */
  26. #define FPSF_V (1 << 7) /* invalid operation flag */
  27. #define FPSF_D (1 << 8) /* denormal/unnormal operand flag */
  28. #define FPSF_Z (1 << 9) /* zero divide (IEEE) flag */
  29. #define FPSF_O (1 << 10) /* overflow (IEEE) flag */
  30. #define FPSF_U (1 << 11) /* underflow (IEEE) flag */
  31. #define FPSF_I (1 << 12) /* inexact (IEEE) flag) */
  32. /* floating-point rounding control: */
  33. #define FPRC_NEAREST 0x0
  34. #define FPRC_NEGINF 0x1
  35. #define FPRC_POSINF 0x2
  36. #define FPRC_TRUNC 0x3
  37. #define FPSF_DEFAULT (FPSF_PC (0x3) | FPSF_RC (FPRC_NEAREST))
  38. /* This default value is the same as HP-UX uses. Don't change it
  39. without a very good reason. */
  40. #define FPSR_DEFAULT (FPSR_TRAP_VD | FPSR_TRAP_DD | FPSR_TRAP_ZD \
  41. | FPSR_TRAP_OD | FPSR_TRAP_UD | FPSR_TRAP_ID \
  42. | FPSR_S0 (FPSF_DEFAULT) \
  43. | FPSR_S1 (FPSF_DEFAULT | FPSF_TD | FPSF_WRE) \
  44. | FPSR_S2 (FPSF_DEFAULT | FPSF_TD) \
  45. | FPSR_S3 (FPSF_DEFAULT | FPSF_TD))
  46. # ifndef __ASSEMBLY__
  47. struct ia64_fpreg {
  48. union {
  49. unsigned long bits[2];
  50. long double __dummy; /* force 16-byte alignment */
  51. } u;
  52. };
  53. # endif /* __ASSEMBLY__ */
  54. #endif /* _ASM_IA64_FPU_H */