Lines Matching full:env
49 void helper_ldtlb(CPUSH4State *env) in helper_ldtlb() argument
52 cpu_abort(env_cpu(env), "Unhandled ldtlb"); in helper_ldtlb()
54 cpu_load_tlb(env); in helper_ldtlb()
59 void raise_exception(CPUSH4State *env, int index, in raise_exception() argument
62 CPUState *cs = env_cpu(env); in raise_exception()
68 void helper_raise_illegal_instruction(CPUSH4State *env) in helper_raise_illegal_instruction() argument
70 raise_exception(env, 0x180, 0); in helper_raise_illegal_instruction()
73 void helper_raise_slot_illegal_instruction(CPUSH4State *env) in helper_raise_slot_illegal_instruction() argument
75 raise_exception(env, 0x1a0, 0); in helper_raise_slot_illegal_instruction()
78 void helper_raise_fpu_disable(CPUSH4State *env) in helper_raise_fpu_disable() argument
80 raise_exception(env, 0x800, 0); in helper_raise_fpu_disable()
83 void helper_raise_slot_fpu_disable(CPUSH4State *env) in helper_raise_slot_fpu_disable() argument
85 raise_exception(env, 0x820, 0); in helper_raise_slot_fpu_disable()
88 void helper_sleep(CPUSH4State *env) in helper_sleep() argument
90 CPUState *cs = env_cpu(env); in helper_sleep()
93 env->in_sleep = 1; in helper_sleep()
94 raise_exception(env, EXCP_HLT, 0); in helper_sleep()
97 void helper_trapa(CPUSH4State *env, uint32_t tra) in helper_trapa() argument
99 env->tra = tra << 2; in helper_trapa()
100 raise_exception(env, 0x160, 0); in helper_trapa()
103 void helper_exclusive(CPUSH4State *env) in helper_exclusive() argument
106 cpu_loop_exit_atomic(env_cpu(env), 0); in helper_exclusive()
109 void helper_movcal(CPUSH4State *env, uint32_t address, uint32_t value) in helper_movcal() argument
111 if (cpu_sh4_is_cached (env, address)) in helper_movcal()
119 *(env->movcal_backup_tail) = r; in helper_movcal()
120 env->movcal_backup_tail = &(r->next); in helper_movcal()
124 void helper_discard_movcal_backup(CPUSH4State *env) in helper_discard_movcal_backup() argument
126 memory_content *current = env->movcal_backup; in helper_discard_movcal_backup()
132 env->movcal_backup = current = next; in helper_discard_movcal_backup()
134 env->movcal_backup_tail = &(env->movcal_backup); in helper_discard_movcal_backup()
138 void helper_ocbi(CPUSH4State *env, uint32_t address) in helper_ocbi() argument
140 memory_content **current = &(env->movcal_backup); in helper_ocbi()
147 cpu_stl_data(env, a, (*current)->value); in helper_ocbi()
151 env->movcal_backup_tail = current; in helper_ocbi()
161 void helper_macl(CPUSH4State *env, int32_t arg0, int32_t arg1) in helper_macl() argument
166 int64_t mac = env->mac; in helper_macl()
169 if (!(env->sr & (1u << SR_S))) { in helper_macl()
177 env->mac = res; in helper_macl()
180 void helper_macw(CPUSH4State *env, int32_t arg0, int32_t arg1) in helper_macw() argument
185 if (env->sr & (1u << SR_S)) { in helper_macw()
191 int32_t res, macl = env->macl; in helper_macw()
196 env->mach = 1; in helper_macw()
198 env->macl = res; in helper_macw()
201 env->mac += mul; in helper_macw()
205 void helper_ld_fpscr(CPUSH4State *env, uint32_t val) in helper_ld_fpscr() argument
207 env->fpscr = val & FPSCR_MASK; in helper_ld_fpscr()
209 set_float_rounding_mode(float_round_to_zero, &env->fp_status); in helper_ld_fpscr()
211 set_float_rounding_mode(float_round_nearest_even, &env->fp_status); in helper_ld_fpscr()
213 set_flush_to_zero((val & FPSCR_DN) != 0, &env->fp_status); in helper_ld_fpscr()
216 static void update_fpscr(CPUSH4State *env, uintptr_t retaddr) in update_fpscr() argument
220 xcpt = get_float_exception_flags(&env->fp_status); in update_fpscr()
223 env->fpscr &= ~FPSCR_CAUSE_MASK; in update_fpscr()
227 env->fpscr |= FPSCR_CAUSE_V; in update_fpscr()
230 env->fpscr |= FPSCR_CAUSE_Z; in update_fpscr()
233 env->fpscr |= FPSCR_CAUSE_O; in update_fpscr()
236 env->fpscr |= FPSCR_CAUSE_U; in update_fpscr()
239 env->fpscr |= FPSCR_CAUSE_I; in update_fpscr()
243 env->fpscr |= (env->fpscr & FPSCR_CAUSE_MASK) in update_fpscr()
247 cause = (env->fpscr & FPSCR_CAUSE_MASK) >> FPSCR_CAUSE_SHIFT; in update_fpscr()
248 enable = (env->fpscr & FPSCR_ENABLE_MASK) >> FPSCR_ENABLE_SHIFT; in update_fpscr()
250 raise_exception(env, 0x120, retaddr); in update_fpscr()
255 float32 helper_fadd_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fadd_FT() argument
257 set_float_exception_flags(0, &env->fp_status); in helper_fadd_FT()
258 t0 = float32_add(t0, t1, &env->fp_status); in helper_fadd_FT()
259 update_fpscr(env, GETPC()); in helper_fadd_FT()
263 float64 helper_fadd_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fadd_DT() argument
265 set_float_exception_flags(0, &env->fp_status); in helper_fadd_DT()
266 t0 = float64_add(t0, t1, &env->fp_status); in helper_fadd_DT()
267 update_fpscr(env, GETPC()); in helper_fadd_DT()
271 uint32_t helper_fcmp_eq_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fcmp_eq_FT() argument
275 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_eq_FT()
276 relation = float32_compare(t0, t1, &env->fp_status); in helper_fcmp_eq_FT()
277 update_fpscr(env, GETPC()); in helper_fcmp_eq_FT()
281 uint32_t helper_fcmp_eq_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fcmp_eq_DT() argument
285 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_eq_DT()
286 relation = float64_compare(t0, t1, &env->fp_status); in helper_fcmp_eq_DT()
287 update_fpscr(env, GETPC()); in helper_fcmp_eq_DT()
291 uint32_t helper_fcmp_gt_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fcmp_gt_FT() argument
295 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_gt_FT()
296 relation = float32_compare(t0, t1, &env->fp_status); in helper_fcmp_gt_FT()
297 update_fpscr(env, GETPC()); in helper_fcmp_gt_FT()
301 uint32_t helper_fcmp_gt_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fcmp_gt_DT() argument
305 set_float_exception_flags(0, &env->fp_status); in helper_fcmp_gt_DT()
306 relation = float64_compare(t0, t1, &env->fp_status); in helper_fcmp_gt_DT()
307 update_fpscr(env, GETPC()); in helper_fcmp_gt_DT()
311 float64 helper_fcnvsd_FT_DT(CPUSH4State *env, float32 t0) in helper_fcnvsd_FT_DT() argument
314 set_float_exception_flags(0, &env->fp_status); in helper_fcnvsd_FT_DT()
315 ret = float32_to_float64(t0, &env->fp_status); in helper_fcnvsd_FT_DT()
316 update_fpscr(env, GETPC()); in helper_fcnvsd_FT_DT()
320 float32 helper_fcnvds_DT_FT(CPUSH4State *env, float64 t0) in helper_fcnvds_DT_FT() argument
323 set_float_exception_flags(0, &env->fp_status); in helper_fcnvds_DT_FT()
324 ret = float64_to_float32(t0, &env->fp_status); in helper_fcnvds_DT_FT()
325 update_fpscr(env, GETPC()); in helper_fcnvds_DT_FT()
329 float32 helper_fdiv_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fdiv_FT() argument
331 set_float_exception_flags(0, &env->fp_status); in helper_fdiv_FT()
332 t0 = float32_div(t0, t1, &env->fp_status); in helper_fdiv_FT()
333 update_fpscr(env, GETPC()); in helper_fdiv_FT()
337 float64 helper_fdiv_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fdiv_DT() argument
339 set_float_exception_flags(0, &env->fp_status); in helper_fdiv_DT()
340 t0 = float64_div(t0, t1, &env->fp_status); in helper_fdiv_DT()
341 update_fpscr(env, GETPC()); in helper_fdiv_DT()
345 float32 helper_float_FT(CPUSH4State *env, uint32_t t0) in helper_float_FT() argument
348 set_float_exception_flags(0, &env->fp_status); in helper_float_FT()
349 ret = int32_to_float32(t0, &env->fp_status); in helper_float_FT()
350 update_fpscr(env, GETPC()); in helper_float_FT()
354 float64 helper_float_DT(CPUSH4State *env, uint32_t t0) in helper_float_DT() argument
357 set_float_exception_flags(0, &env->fp_status); in helper_float_DT()
358 ret = int32_to_float64(t0, &env->fp_status); in helper_float_DT()
359 update_fpscr(env, GETPC()); in helper_float_DT()
363 float32 helper_fmac_FT(CPUSH4State *env, float32 t0, float32 t1, float32 t2) in helper_fmac_FT() argument
365 set_float_exception_flags(0, &env->fp_status); in helper_fmac_FT()
366 t0 = float32_muladd(t0, t1, t2, 0, &env->fp_status); in helper_fmac_FT()
367 update_fpscr(env, GETPC()); in helper_fmac_FT()
371 float32 helper_fmul_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fmul_FT() argument
373 set_float_exception_flags(0, &env->fp_status); in helper_fmul_FT()
374 t0 = float32_mul(t0, t1, &env->fp_status); in helper_fmul_FT()
375 update_fpscr(env, GETPC()); in helper_fmul_FT()
379 float64 helper_fmul_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fmul_DT() argument
381 set_float_exception_flags(0, &env->fp_status); in helper_fmul_DT()
382 t0 = float64_mul(t0, t1, &env->fp_status); in helper_fmul_DT()
383 update_fpscr(env, GETPC()); in helper_fmul_DT()
387 float32 helper_fsqrt_FT(CPUSH4State *env, float32 t0) in helper_fsqrt_FT() argument
389 set_float_exception_flags(0, &env->fp_status); in helper_fsqrt_FT()
390 t0 = float32_sqrt(t0, &env->fp_status); in helper_fsqrt_FT()
391 update_fpscr(env, GETPC()); in helper_fsqrt_FT()
395 float64 helper_fsqrt_DT(CPUSH4State *env, float64 t0) in helper_fsqrt_DT() argument
397 set_float_exception_flags(0, &env->fp_status); in helper_fsqrt_DT()
398 t0 = float64_sqrt(t0, &env->fp_status); in helper_fsqrt_DT()
399 update_fpscr(env, GETPC()); in helper_fsqrt_DT()
403 float32 helper_fsrra_FT(CPUSH4State *env, float32 t0) in helper_fsrra_FT() argument
405 set_float_exception_flags(0, &env->fp_status); in helper_fsrra_FT()
407 t0 = float32_sqrt(t0, &env->fp_status); in helper_fsrra_FT()
408 t0 = float32_div(float32_one, t0, &env->fp_status); in helper_fsrra_FT()
414 if (get_float_exception_flags(&env->fp_status) == 0) { in helper_fsrra_FT()
415 set_float_exception_flags(float_flag_inexact, &env->fp_status); in helper_fsrra_FT()
417 update_fpscr(env, GETPC()); in helper_fsrra_FT()
421 float32 helper_fsub_FT(CPUSH4State *env, float32 t0, float32 t1) in helper_fsub_FT() argument
423 set_float_exception_flags(0, &env->fp_status); in helper_fsub_FT()
424 t0 = float32_sub(t0, t1, &env->fp_status); in helper_fsub_FT()
425 update_fpscr(env, GETPC()); in helper_fsub_FT()
429 float64 helper_fsub_DT(CPUSH4State *env, float64 t0, float64 t1) in helper_fsub_DT() argument
431 set_float_exception_flags(0, &env->fp_status); in helper_fsub_DT()
432 t0 = float64_sub(t0, t1, &env->fp_status); in helper_fsub_DT()
433 update_fpscr(env, GETPC()); in helper_fsub_DT()
437 uint32_t helper_ftrc_FT(CPUSH4State *env, float32 t0) in helper_ftrc_FT() argument
440 set_float_exception_flags(0, &env->fp_status); in helper_ftrc_FT()
441 ret = float32_to_int32_round_to_zero(t0, &env->fp_status); in helper_ftrc_FT()
442 update_fpscr(env, GETPC()); in helper_ftrc_FT()
446 uint32_t helper_ftrc_DT(CPUSH4State *env, float64 t0) in helper_ftrc_DT() argument
449 set_float_exception_flags(0, &env->fp_status); in helper_ftrc_DT()
450 ret = float64_to_int32_round_to_zero(t0, &env->fp_status); in helper_ftrc_DT()
451 update_fpscr(env, GETPC()); in helper_ftrc_DT()
455 void helper_fipr(CPUSH4State *env, uint32_t m, uint32_t n) in helper_fipr() argument
460 bank = (env->sr & FPSCR_FR) ? 16 : 0; in helper_fipr()
462 set_float_exception_flags(0, &env->fp_status); in helper_fipr()
465 p = float32_mul(env->fregs[bank + m + i], in helper_fipr()
466 env->fregs[bank + n + i], in helper_fipr()
467 &env->fp_status); in helper_fipr()
468 r = float32_add(r, p, &env->fp_status); in helper_fipr()
470 update_fpscr(env, GETPC()); in helper_fipr()
472 env->fregs[bank + n + 3] = r; in helper_fipr()
475 void helper_ftrv(CPUSH4State *env, uint32_t n) in helper_ftrv() argument
482 bank_matrix = (env->sr & FPSCR_FR) ? 0 : 16; in helper_ftrv()
483 bank_vector = (env->sr & FPSCR_FR) ? 16 : 0; in helper_ftrv()
484 set_float_exception_flags(0, &env->fp_status); in helper_ftrv()
488 p = float32_mul(env->fregs[bank_matrix + 4 * j + i], in helper_ftrv()
489 env->fregs[bank_vector + j], in helper_ftrv()
490 &env->fp_status); in helper_ftrv()
491 r[i] = float32_add(r[i], p, &env->fp_status); in helper_ftrv()
494 update_fpscr(env, GETPC()); in helper_ftrv()
497 env->fregs[bank_vector + i] = r[i]; in helper_ftrv()