Lines Matching full:env

48 void helper_ldtlb(CPUSH4State *env)  in helper_ldtlb()  argument
51 cpu_abort(env_cpu(env), "Unhandled ldtlb"); in helper_ldtlb()
53 cpu_load_tlb(env); in helper_ldtlb()
58 void raise_exception(CPUSH4State *env, int index, in raise_exception() argument
61 CPUState *cs = env_cpu(env); in raise_exception()
67 void helper_raise_illegal_instruction(CPUSH4State *env) in helper_raise_illegal_instruction() argument
69 raise_exception(env, 0x180, 0); in helper_raise_illegal_instruction()
72 void helper_raise_slot_illegal_instruction(CPUSH4State *env) in helper_raise_slot_illegal_instruction() argument
74 raise_exception(env, 0x1a0, 0); in helper_raise_slot_illegal_instruction()
77 void helper_raise_fpu_disable(CPUSH4State *env) in helper_raise_fpu_disable() argument
79 raise_exception(env, 0x800, 0); in helper_raise_fpu_disable()
82 void helper_raise_slot_fpu_disable(CPUSH4State *env) in helper_raise_slot_fpu_disable() argument
84 raise_exception(env, 0x820, 0); in helper_raise_slot_fpu_disable()
87 void helper_sleep(CPUSH4State *env) in helper_sleep() argument
89 CPUState *cs = env_cpu(env); in helper_sleep()
92 env->in_sleep = 1; in helper_sleep()
93 raise_exception(env, EXCP_HLT, 0); in helper_sleep()
96 void helper_trapa(CPUSH4State *env, uint32_t tra) in helper_trapa() argument
98 env->tra = tra << 2; in helper_trapa()
99 raise_exception(env, 0x160, 0); in helper_trapa()
102 void helper_exclusive(CPUSH4State *env) in helper_exclusive() argument
105 cpu_loop_exit_atomic(env_cpu(env), 0); in helper_exclusive()
108 void helper_movcal(CPUSH4State *env, uint32_t address, uint32_t value) in helper_movcal() argument
110 if (cpu_sh4_is_cached (env, address)) in helper_movcal()
118 *(env->movcal_backup_tail) = r; in helper_movcal()
119 env->movcal_backup_tail = &(r->next); in helper_movcal()
123 void helper_discard_movcal_backup(CPUSH4State *env) in helper_discard_movcal_backup() argument
125 memory_content *current = env->movcal_backup; in helper_discard_movcal_backup()
131 env->movcal_backup = current = next; in helper_discard_movcal_backup()
133 env->movcal_backup_tail = &(env->movcal_backup); in helper_discard_movcal_backup()
137 void helper_ocbi(CPUSH4State *env, uint32_t address) in helper_ocbi() argument
139 memory_content **current = &(env->movcal_backup); in helper_ocbi()
146 cpu_stl_data(env, a, (*current)->value); in helper_ocbi()
150 env->movcal_backup_tail = current; in helper_ocbi()
160 void helper_macl(CPUSH4State *env, int32_t arg0, int32_t arg1) in helper_macl() argument
165 int64_t mac = env->mac; in helper_macl()
168 if (!(env->sr & (1u << SR_S))) { in helper_macl()
176 env->mac = res; in helper_macl()
179 void helper_macw(CPUSH4State *env, int32_t arg0, int32_t arg1) in helper_macw() argument
184 if (env->sr & (1u << SR_S)) { in helper_macw()
190 int32_t res, macl = env->macl; in helper_macw()
195 env->mach = 1; in helper_macw()
197 env->macl = res; in helper_macw()
200 env->mac += mul; in helper_macw()
204 void helper_ld_fpscr(CPUSH4State *env, uint32_t val) in helper_ld_fpscr() argument
206 env->fpscr = val & FPSCR_MASK; in helper_ld_fpscr()
208 set_float_rounding_mode(float_round_to_zero, &env->fp_status); in helper_ld_fpscr()
210 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ld_fpscr()
212 set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status); in helper_ld_fpscr()
215 static void update_fpscr(CPUSH4State *env, uintptr_t retaddr) in update_fpscr() argument
219 xcpt = get_float_exception_flags(&env->fp_status); in update_fpscr()
222 env->fpscr &= ~FPSCR_CAUSE_MASK; in update_fpscr()
226 env->fpscr |= FPSCR_CAUSE_V; in update_fpscr()
229 env->fpscr |= FPSCR_CAUSE_Z; in update_fpscr()
232 env->fpscr |= FPSCR_CAUSE_O; in update_fpscr()
235 env->fpscr |= FPSCR_CAUSE_U; in update_fpscr()
238 env->fpscr |= FPSCR_CAUSE_I; in update_fpscr()
242 env->fpscr |= (env->fpscr & FPSCR_CAUSE_MASK) in update_fpscr()
246 cause = (env->fpscr & FPSCR_CAUSE_MASK) >> FPSCR_CAUSE_SHIFT; in update_fpscr()
247 enable = (env->fpscr & FPSCR_ENABLE_MASK) >> FPSCR_ENABLE_SHIFT; in update_fpscr()
249 raise_exception(env, 0x120, retaddr); in update_fpscr()
254 float32 helper_fadd_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fadd_FT() argument
256 set_float_exception_flags(0, &env->fp_status); in helper_fadd_FT()
257 t0 = float32_add(t0, t1, &env->fp_status); in helper_fadd_FT()
258 update_fpscr(env, GETPC()); in helper_fadd_FT()
262 float64 helper_fadd_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fadd_DT() argument
264 set_float_exception_flags(0, &env->fp_status); in helper_fadd_DT()
265 t0 = float64_add(t0, t1, &env->fp_status); in helper_fadd_DT()
266 update_fpscr(env, GETPC()); in helper_fadd_DT()
270 uint32_t helper_fcmp_eq_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fcmp_eq_FT() argument
274 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_eq_FT()
275 relation = float32_compare(t0, t1, &env->fp_status); in helper_fcmp_eq_FT()
276 update_fpscr(env, GETPC()); in helper_fcmp_eq_FT()
280 uint32_t helper_fcmp_eq_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fcmp_eq_DT() argument
284 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_eq_DT()
285 relation = float64_compare(t0, t1, &env->fp_status); in helper_fcmp_eq_DT()
286 update_fpscr(env, GETPC()); in helper_fcmp_eq_DT()
290 uint32_t helper_fcmp_gt_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fcmp_gt_FT() argument
294 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_gt_FT()
295 relation = float32_compare(t0, t1, &env->fp_status); in helper_fcmp_gt_FT()
296 update_fpscr(env, GETPC()); in helper_fcmp_gt_FT()
300 uint32_t helper_fcmp_gt_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fcmp_gt_DT() argument
304 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_gt_DT()
305 relation = float64_compare(t0, t1, &env->fp_status); in helper_fcmp_gt_DT()
306 update_fpscr(env, GETPC()); in helper_fcmp_gt_DT()
310 float64 helper_fcnvsd_FT_DT(CPUSH4State *env, float32 t0) in helper_fcnvsd_FT_DT() argument
313 set_float_exception_flags(0, &env->fp_status); in helper_fcnvsd_FT_DT()
314 ret = float32_to_float64(t0, &env->fp_status); in helper_fcnvsd_FT_DT()
315 update_fpscr(env, GETPC()); in helper_fcnvsd_FT_DT()
319 float32 helper_fcnvds_DT_FT(CPUSH4State *env, float64 t0) in helper_fcnvds_DT_FT() argument
322 set_float_exception_flags(0, &env->fp_status); in helper_fcnvds_DT_FT()
323 ret = float64_to_float32(t0, &env->fp_status); in helper_fcnvds_DT_FT()
324 update_fpscr(env, GETPC()); in helper_fcnvds_DT_FT()
328 float32 helper_fdiv_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fdiv_FT() argument
330 set_float_exception_flags(0, &env->fp_status); in helper_fdiv_FT()
331 t0 = float32_div(t0, t1, &env->fp_status); in helper_fdiv_FT()
332 update_fpscr(env, GETPC()); in helper_fdiv_FT()
336 float64 helper_fdiv_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fdiv_DT() argument
338 set_float_exception_flags(0, &env->fp_status); in helper_fdiv_DT()
339 t0 = float64_div(t0, t1, &env->fp_status); in helper_fdiv_DT()
340 update_fpscr(env, GETPC()); in helper_fdiv_DT()
344 float32 helper_float_FT(CPUSH4State *env, uint32_t t0) in helper_float_FT() argument
347 set_float_exception_flags(0, &env->fp_status); in helper_float_FT()
348 ret = int32_to_float32(t0, &env->fp_status); in helper_float_FT()
349 update_fpscr(env, GETPC()); in helper_float_FT()
353 float64 helper_float_DT(CPUSH4State *env, uint32_t t0) in helper_float_DT() argument
356 set_float_exception_flags(0, &env->fp_status); in helper_float_DT()
357 ret = int32_to_float64(t0, &env->fp_status); in helper_float_DT()
358 update_fpscr(env, GETPC()); in helper_float_DT()
362 float32 helper_fmac_FT(CPUSH4State *env, float32 t0, float32 t1, float32 t2) in helper_fmac_FT() argument
364 set_float_exception_flags(0, &env->fp_status); in helper_fmac_FT()
365 t0 = float32_muladd(t0, t1, t2, 0, &env->fp_status); in helper_fmac_FT()
366 update_fpscr(env, GETPC()); in helper_fmac_FT()
370 float32 helper_fmul_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fmul_FT() argument
372 set_float_exception_flags(0, &env->fp_status); in helper_fmul_FT()
373 t0 = float32_mul(t0, t1, &env->fp_status); in helper_fmul_FT()
374 update_fpscr(env, GETPC()); in helper_fmul_FT()
378 float64 helper_fmul_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fmul_DT() argument
380 set_float_exception_flags(0, &env->fp_status); in helper_fmul_DT()
381 t0 = float64_mul(t0, t1, &env->fp_status); in helper_fmul_DT()
382 update_fpscr(env, GETPC()); in helper_fmul_DT()
386 float32 helper_fsqrt_FT(CPUSH4State *env, float32 t0) in helper_fsqrt_FT() argument
388 set_float_exception_flags(0, &env->fp_status); in helper_fsqrt_FT()
389 t0 = float32_sqrt(t0, &env->fp_status); in helper_fsqrt_FT()
390 update_fpscr(env, GETPC()); in helper_fsqrt_FT()
394 float64 helper_fsqrt_DT(CPUSH4State *env, float64 t0) in helper_fsqrt_DT() argument
396 set_float_exception_flags(0, &env->fp_status); in helper_fsqrt_DT()
397 t0 = float64_sqrt(t0, &env->fp_status); in helper_fsqrt_DT()
398 update_fpscr(env, GETPC()); in helper_fsqrt_DT()
402 float32 helper_fsrra_FT(CPUSH4State *env, float32 t0) in helper_fsrra_FT() argument
404 set_float_exception_flags(0, &env->fp_status); in helper_fsrra_FT()
406 t0 = float32_sqrt(t0, &env->fp_status); in helper_fsrra_FT()
407 t0 = float32_div(float32_one, t0, &env->fp_status); in helper_fsrra_FT()
413 if (get_float_exception_flags(&env->fp_status) == 0) { in helper_fsrra_FT()
414 set_float_exception_flags(float_flag_inexact, &env->fp_status); in helper_fsrra_FT()
416 update_fpscr(env, GETPC()); in helper_fsrra_FT()
420 float32 helper_fsub_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fsub_FT() argument
422 set_float_exception_flags(0, &env->fp_status); in helper_fsub_FT()
423 t0 = float32_sub(t0, t1, &env->fp_status); in helper_fsub_FT()
424 update_fpscr(env, GETPC()); in helper_fsub_FT()
428 float64 helper_fsub_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fsub_DT() argument
430 set_float_exception_flags(0, &env->fp_status); in helper_fsub_DT()
431 t0 = float64_sub(t0, t1, &env->fp_status); in helper_fsub_DT()
432 update_fpscr(env, GETPC()); in helper_fsub_DT()
436 uint32_t helper_ftrc_FT(CPUSH4State *env, float32 t0) in helper_ftrc_FT() argument
439 set_float_exception_flags(0, &env->fp_status); in helper_ftrc_FT()
440 ret = float32_to_int32_round_to_zero(t0, &env->fp_status); in helper_ftrc_FT()
441 update_fpscr(env, GETPC()); in helper_ftrc_FT()
445 uint32_t helper_ftrc_DT(CPUSH4State *env, float64 t0) in helper_ftrc_DT() argument
448 set_float_exception_flags(0, &env->fp_status); in helper_ftrc_DT()
449 ret = float64_to_int32_round_to_zero(t0, &env->fp_status); in helper_ftrc_DT()
450 update_fpscr(env, GETPC()); in helper_ftrc_DT()
454 void helper_fipr(CPUSH4State *env, uint32_t m, uint32_t n) in helper_fipr() argument
459 bank = (env->sr & FPSCR_FR) ? 16 : 0; in helper_fipr()
461 set_float_exception_flags(0, &env->fp_status); in helper_fipr()
464 p = float32_mul(env->fregs[bank + m + i], in helper_fipr()
465 env->fregs[bank + n + i], in helper_fipr()
466 &env->fp_status); in helper_fipr()
467 r = float32_add(r, p, &env->fp_status); in helper_fipr()
469 update_fpscr(env, GETPC()); in helper_fipr()
471 env->fregs[bank + n + 3] = r; in helper_fipr()
474 void helper_ftrv(CPUSH4State *env, uint32_t n) in helper_ftrv() argument
481 bank_matrix = (env->sr & FPSCR_FR) ? 0 : 16; in helper_ftrv()
482 bank_vector = (env->sr & FPSCR_FR) ? 16 : 0; in helper_ftrv()
483 set_float_exception_flags(0, &env->fp_status); in helper_ftrv()
487 p = float32_mul(env->fregs[bank_matrix + 4 * j + i], in helper_ftrv()
488 env->fregs[bank_vector + j], in helper_ftrv()
489 &env->fp_status); in helper_ftrv()
490 r[i] = float32_add(r[i], p, &env->fp_status); in helper_ftrv()
493 update_fpscr(env, GETPC()); in helper_ftrv()
496 env->fregs[bank_vector + i] = r[i]; in helper_ftrv()