@@ -103,6 +103,49 @@ uc_err reg_read(void *_env, int mode, unsigned int regid, void *value,
103
103
CHECK_REG_TYPE (mipsreg_t );
104
104
* (mipsreg_t * )value = env -> active_tc .CP0_UserLocal ;
105
105
break ;
106
+ case UC_MIPS_REG_F0 :
107
+ case UC_MIPS_REG_F1 :
108
+ case UC_MIPS_REG_F2 :
109
+ case UC_MIPS_REG_F3 :
110
+ case UC_MIPS_REG_F4 :
111
+ case UC_MIPS_REG_F5 :
112
+ case UC_MIPS_REG_F6 :
113
+ case UC_MIPS_REG_F7 :
114
+ case UC_MIPS_REG_F8 :
115
+ case UC_MIPS_REG_F9 :
116
+ case UC_MIPS_REG_F10 :
117
+ case UC_MIPS_REG_F11 :
118
+ case UC_MIPS_REG_F12 :
119
+ case UC_MIPS_REG_F13 :
120
+ case UC_MIPS_REG_F14 :
121
+ case UC_MIPS_REG_F15 :
122
+ case UC_MIPS_REG_F16 :
123
+ case UC_MIPS_REG_F17 :
124
+ case UC_MIPS_REG_F18 :
125
+ case UC_MIPS_REG_F19 :
126
+ case UC_MIPS_REG_F20 :
127
+ case UC_MIPS_REG_F21 :
128
+ case UC_MIPS_REG_F22 :
129
+ case UC_MIPS_REG_F23 :
130
+ case UC_MIPS_REG_F24 :
131
+ case UC_MIPS_REG_F25 :
132
+ case UC_MIPS_REG_F26 :
133
+ case UC_MIPS_REG_F27 :
134
+ case UC_MIPS_REG_F28 :
135
+ case UC_MIPS_REG_F29 :
136
+ case UC_MIPS_REG_F30 :
137
+ case UC_MIPS_REG_F31 :
138
+ CHECK_REG_TYPE (uint64_t );
139
+ * (uint64_t * )value = env -> active_fpu .fpr [regid - UC_MIPS_REG_F0 ].d ;
140
+ break ;
141
+ case UC_MIPS_REG_FIR :
142
+ CHECK_REG_TYPE (uint32_t );
143
+ * (uint32_t * )value = env -> active_fpu .fcr0 ;
144
+ break ;
145
+ case UC_MIPS_REG_FCSR :
146
+ CHECK_REG_TYPE (uint32_t );
147
+ * (uint32_t * )value = env -> active_fpu .fcr31 ;
148
+ break ;
106
149
}
107
150
}
108
151
@@ -158,6 +201,57 @@ uc_err reg_write(void *_env, int mode, unsigned int regid, const void *value,
158
201
CHECK_REG_TYPE (mipsreg_t );
159
202
env -> active_tc .CP0_UserLocal = * (mipsreg_t * )value ;
160
203
break ;
204
+ case UC_MIPS_REG_F0 :
205
+ case UC_MIPS_REG_F1 :
206
+ case UC_MIPS_REG_F2 :
207
+ case UC_MIPS_REG_F3 :
208
+ case UC_MIPS_REG_F4 :
209
+ case UC_MIPS_REG_F5 :
210
+ case UC_MIPS_REG_F6 :
211
+ case UC_MIPS_REG_F7 :
212
+ case UC_MIPS_REG_F8 :
213
+ case UC_MIPS_REG_F9 :
214
+ case UC_MIPS_REG_F10 :
215
+ case UC_MIPS_REG_F11 :
216
+ case UC_MIPS_REG_F12 :
217
+ case UC_MIPS_REG_F13 :
218
+ case UC_MIPS_REG_F14 :
219
+ case UC_MIPS_REG_F15 :
220
+ case UC_MIPS_REG_F16 :
221
+ case UC_MIPS_REG_F17 :
222
+ case UC_MIPS_REG_F18 :
223
+ case UC_MIPS_REG_F19 :
224
+ case UC_MIPS_REG_F20 :
225
+ case UC_MIPS_REG_F21 :
226
+ case UC_MIPS_REG_F22 :
227
+ case UC_MIPS_REG_F23 :
228
+ case UC_MIPS_REG_F24 :
229
+ case UC_MIPS_REG_F25 :
230
+ case UC_MIPS_REG_F26 :
231
+ case UC_MIPS_REG_F27 :
232
+ case UC_MIPS_REG_F28 :
233
+ case UC_MIPS_REG_F29 :
234
+ case UC_MIPS_REG_F30 :
235
+ case UC_MIPS_REG_F31 :
236
+ CHECK_REG_TYPE (uint64_t );
237
+ env -> active_fpu .fpr [regid - UC_MIPS_REG_F0 ].d = * (uint64_t * )value ;
238
+ break ;
239
+ case UC_MIPS_REG_FCSR : {
240
+ CHECK_REG_TYPE (uint32_t );
241
+ uint32_t arg1 = * (uint32_t * )value ;
242
+ uint32_t original = env -> active_fpu .fcr31 ;
243
+ env -> active_fpu .fcr31 = (arg1 & env -> active_fpu .fcr31_rw_bitmask ) |
244
+ (env -> active_fpu .fcr31 & ~(env -> active_fpu .fcr31_rw_bitmask ));
245
+ if ((GET_FP_ENABLE (env -> active_fpu .fcr31 ) | 0x20 ) &
246
+ GET_FP_CAUSE (env -> active_fpu .fcr31 )) {
247
+ env -> active_fpu .fcr31 = original ;
248
+ ret = UC_ERR_EXCEPTION ;
249
+ } else {
250
+ restore_fp_status (env );
251
+ set_float_exception_flags (0 , & env -> active_fpu .fp_status );
252
+ }
253
+ break ;
254
+ }
161
255
}
162
256
}
163
257
0 commit comments