fpu.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //*****************************************************************************
  2. //
  3. // fpu.h - Prototypes for the floatint point manipulation routines.
  4. //
  5. // Copyright (c) 2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Peripheral Driver Library.
  22. //
  23. //*****************************************************************************
  24. #ifndef __FPU_H__
  25. #define __FPU_H__
  26. //*****************************************************************************
  27. //
  28. // If building with a C++ compiler, make all of the definitions in this header
  29. // have a C binding.
  30. //
  31. //*****************************************************************************
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. //*****************************************************************************
  37. //
  38. // Values that can be passed to FPUHalfPrecisionSet as the ulMode parameter.
  39. //
  40. //*****************************************************************************
  41. #define FPU_HALF_IEEE 0x00000000
  42. #define FPU_HALF_ALTERNATE 0x04000000
  43. //*****************************************************************************
  44. //
  45. // Values that can be passed to FPUNaNModeSet as the ulMode parameter.
  46. //
  47. //*****************************************************************************
  48. #define FPU_NAN_PROPAGATE 0x00000000
  49. #define FPU_NAN_DEFAULT 0x02000000
  50. //*****************************************************************************
  51. //
  52. // Values that can be passed to FPUFlushToZeroModeSet as the ulMode parameter.
  53. //
  54. //*****************************************************************************
  55. #define FPU_FLUSH_TO_ZERO_DIS 0x00000000
  56. #define FPU_FLUSH_TO_ZERO_EN 0x01000000
  57. //*****************************************************************************
  58. //
  59. // Values that can be passed to FPURoundingModeSet as the ulMode parameter.
  60. //
  61. //*****************************************************************************
  62. #define FPU_ROUND_NEAREST 0x00000000
  63. #define FPU_ROUND_POS_INF 0x00400000
  64. #define FPU_ROUND_NEG_INF 0x00800000
  65. #define FPU_ROUND_ZERO 0x00c00000
  66. //*****************************************************************************
  67. //
  68. // Prototypes.
  69. //
  70. //*****************************************************************************
  71. extern void FPUEnable(void);
  72. extern void FPUDisable(void);
  73. extern void FPUStackingEnable(void);
  74. extern void FPULazyStackingEnable(void);
  75. extern void FPUStackingDisable(void);
  76. extern void FPUHalfPrecisionModeSet(unsigned long ulMode);
  77. extern void FPUNaNModeSet(unsigned long ulMode);
  78. extern void FPUFlushToZeroModeSet(unsigned long ulMode);
  79. extern void FPURoundingModeSet(unsigned long ulMode);
  80. //*****************************************************************************
  81. //
  82. // Mark the end of the C bindings section for C++ compilers.
  83. //
  84. //*****************************************************************************
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif // __FPU_H__