pspsdk-1.0+beta2
pspfpu.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspfpu.h - Prototypes for the FPU library
7  *
8  * Copyright (c) 2006 TyRaNiD (James F.)
9  *
10  * $Id: pspfpu.h 1782 2006-02-04 12:57:05Z tyranid $
11  */
12 #ifndef __PSPFPU_H__
13 #define __PSPFPU_H__
14 
15 #include <stdint.h>
16 
17 /* Note the bit settings in here come from an NEC MIPSv4 document,
18  * they seem sensible.
19  */
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
27 {
29  FPU_RN = 0,
31  FPU_RZ = 1,
33  FPU_RP = 2,
35  FPU_RM = 3,
36 };
37 
39 #define FPU_RM_MASK 0x03
40 
43 {
58 };
59 
61 #define FPU_FLAGS_POS 2
62 
63 #define FPU_ENABLE_POS 7
64 
65 #define FPU_CAUSE_POS 12
66 
67 #define FPU_CC0_POS 23
68 
69 #define FPU_FS_POS 24
70 
71 #define FPU_CC17_POS 25
72 
73 #define FPU_FLAGS_MASK (0x1F << FPU_FLAGS_POS)
74 #define FPU_ENABLE_MASK (0x1F << FPU_ENABLE_POS)
75 #define FPU_CAUSE_MASK (0x3F << FPU_CAUSE_POS)
76 #define FPU_CC0_MASK (1 << FPU_CC0_POS)
77 #define FPU_FS_MASK (1 << FPU_FS_POS)
78 #define FPU_CC17_MASK (0x7F << FPU_CC17_POS)
79 
86 
92 void pspfpu_set_fcr31(uint32_t var);
93 
99 void pspfpu_set_roundmode(enum FpuRoundMode mode);
100 
107 
115 
121 void pspfpu_clear_flags(uint32_t clear);
122 
129 
135 void pspfpu_set_enable(uint32_t enable);
136 
143 
150 void pspfpu_clear_cause(uint32_t clear);
151 
158 uint32_t pspfpu_get_fs(void);
159 
165 void pspfpu_set_fs(uint32_t fs);
166 
173 
179 void pspfpu_clear_condbits(uint32_t clear);
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif /* __PSPFPU_H__ */