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 
25 #ifndef __FPU_H__
26 #define __FPU_H__
27 
28 //*****************************************************************************
29 //
30 // If building with a C++ compiler, make all of the definitions in this header
31 // have a C binding.
32 //
33 //*****************************************************************************
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 //*****************************************************************************
40 //
41 // Values that can be passed to FPUHalfPrecisionSet as the ulMode parameter.
42 //
43 //*****************************************************************************
44 #define FPU_HALF_IEEE           0x00000000
45 #define FPU_HALF_ALTERNATE      0x04000000
46 
47 //*****************************************************************************
48 //
49 // Values that can be passed to FPUNaNModeSet as the ulMode parameter.
50 //
51 //*****************************************************************************
52 #define FPU_NAN_PROPAGATE       0x00000000
53 #define FPU_NAN_DEFAULT         0x02000000
54 
55 //*****************************************************************************
56 //
57 // Values that can be passed to FPUFlushToZeroModeSet as the ulMode parameter.
58 //
59 //*****************************************************************************
60 #define FPU_FLUSH_TO_ZERO_DIS   0x00000000
61 #define FPU_FLUSH_TO_ZERO_EN    0x01000000
62 
63 //*****************************************************************************
64 //
65 // Values that can be passed to FPURoundingModeSet as the ulMode parameter.
66 //
67 //*****************************************************************************
68 #define FPU_ROUND_NEAREST       0x00000000
69 #define FPU_ROUND_POS_INF       0x00400000
70 #define FPU_ROUND_NEG_INF       0x00800000
71 #define FPU_ROUND_ZERO          0x00c00000
72 
73 //*****************************************************************************
74 //
75 // Prototypes.
76 //
77 //*****************************************************************************
78 extern void FPUEnable(void);
79 extern void FPUDisable(void);
80 extern void FPUStackingEnable(void);
81 extern void FPULazyStackingEnable(void);
82 extern void FPUStackingDisable(void);
83 extern void FPUHalfPrecisionModeSet(unsigned long ulMode);
84 extern void FPUNaNModeSet(unsigned long ulMode);
85 extern void FPUFlushToZeroModeSet(unsigned long ulMode);
86 extern void FPURoundingModeSet(unsigned long ulMode);
87 
88 //*****************************************************************************
89 //
90 // Mark the end of the C bindings section for C++ compilers.
91 //
92 //*****************************************************************************
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif // __FPU_H__
98