59
65
cpu_restore_state(tb, env, pc, NULL);
69
void helper_ldtlb(void)
71
#ifdef CONFIG_USER_ONLY
79
void helper_raise_illegal_instruction(void)
81
env->exception_index = 0x180;
85
void helper_raise_slot_illegal_instruction(void)
87
env->exception_index = 0x1a0;
91
void helper_debug(void)
93
env->exception_index = EXCP_DEBUG;
97
void helper_sleep(uint32_t next_pc)
100
env->exception_index = EXCP_HLT;
105
void helper_trapa(uint32_t tra)
108
env->exception_index = 0x160;
112
uint32_t helper_addc(uint32_t arg0, uint32_t arg1)
75
void helper_addc_T0_T1(void)
114
77
uint32_t tmp0, tmp1;
118
arg1 = tmp1 + (env->sr & 1);
81
T1 = tmp1 + (env->sr & 1);
128
uint32_t helper_addv(uint32_t arg0, uint32_t arg1)
90
void helper_addv_T0_T1(void)
130
92
uint32_t dest, src, ans;
132
if ((int32_t) arg1 >= 0)
94
if ((int32_t) T1 >= 0)
136
if ((int32_t) arg0 >= 0)
98
if ((int32_t) T0 >= 0)
142
if ((int32_t) arg1 >= 0)
104
if ((int32_t) T1 >= 0)
271
//printf("Output: arg1=0x%08x M=%d Q=%d T=%d\n", arg1, M, Q, T);
275
void helper_macl(uint32_t arg0, uint32_t arg1)
232
//printf("Output: T1=0x%08x M=%d Q=%d T=%d\n", T1, M, Q, T);
235
void helper_dmulsl_T0_T1()
239
res = (int64_t) (int32_t) T0 *(int64_t) (int32_t) T1;
240
env->mach = (res >> 32) & 0xffffffff;
241
env->macl = res & 0xffffffff;
244
void helper_dmulul_T0_T1()
248
res = (uint64_t) (uint32_t) T0 *(uint64_t) (uint32_t) T1;
249
env->mach = (res >> 32) & 0xffffffff;
250
env->macl = res & 0xffffffff;
253
void helper_macl_T0_T1()
279
257
res = ((uint64_t) env->mach << 32) | env->macl;
280
res += (int64_t) (int32_t) arg0 *(int64_t) (int32_t) arg1;
258
res += (int64_t) (int32_t) T0 *(int64_t) (int32_t) T1;
281
259
env->mach = (res >> 32) & 0xffffffff;
282
260
env->macl = res & 0xffffffff;
283
261
if (env->sr & SR_S) {
364
340
env->sr &= ~SR_T;
366
342
env->sr &= ~SR_T;
370
static inline void set_t(void)
375
static inline void clr_t(void)
380
void helper_ld_fpscr(uint32_t val)
382
env->fpscr = val & 0x003fffff;
384
set_float_rounding_mode(float_round_to_zero, &env->fp_status);
386
set_float_rounding_mode(float_round_nearest_even, &env->fp_status);
389
uint32_t helper_fabs_FT(uint32_t t0)
391
float32 ret = float32_abs(*(float32*)&t0);
392
return *(uint32_t*)(&ret);
395
uint64_t helper_fabs_DT(uint64_t t0)
397
float64 ret = float64_abs(*(float64*)&t0);
398
return *(uint64_t*)(&ret);
401
uint32_t helper_fadd_FT(uint32_t t0, uint32_t t1)
403
float32 ret = float32_add(*(float32*)&t0, *(float32*)&t1, &env->fp_status);
404
return *(uint32_t*)(&ret);
407
uint64_t helper_fadd_DT(uint64_t t0, uint64_t t1)
409
float64 ret = float64_add(*(float64*)&t0, *(float64*)&t1, &env->fp_status);
410
return *(uint64_t*)(&ret);
413
void helper_fcmp_eq_FT(uint32_t t0, uint32_t t1)
415
if (float32_compare(*(float32*)&t0, *(float32*)&t1, &env->fp_status) == 0)
421
void helper_fcmp_eq_DT(uint64_t t0, uint64_t t1)
423
if (float64_compare(*(float64*)&t0, *(float64*)&t1, &env->fp_status) == 0)
429
void helper_fcmp_gt_FT(uint32_t t0, uint32_t t1)
431
if (float32_compare(*(float32*)&t0, *(float32*)&t1, &env->fp_status) == 1)
437
void helper_fcmp_gt_DT(uint64_t t0, uint64_t t1)
439
if (float64_compare(*(float64*)&t0, *(float64*)&t1, &env->fp_status) == 1)
445
uint64_t helper_fcnvsd_FT_DT(uint32_t t0)
447
float64 ret = float32_to_float64(*(float32*)&t0, &env->fp_status);
448
return *(uint64_t*)(&ret);
451
uint32_t helper_fcnvds_DT_FT(uint64_t t0)
453
float32 ret = float64_to_float32(*(float64*)&t0, &env->fp_status);
454
return *(uint32_t*)(&ret);
457
uint32_t helper_fdiv_FT(uint32_t t0, uint32_t t1)
459
float32 ret = float32_div(*(float32*)&t0, *(float32*)&t1, &env->fp_status);
460
return *(uint32_t*)(&ret);
463
uint64_t helper_fdiv_DT(uint64_t t0, uint64_t t1)
465
float64 ret = float64_div(*(float64*)&t0, *(float64*)&t1, &env->fp_status);
466
return *(uint64_t*)(&ret);
469
uint32_t helper_float_FT(uint32_t t0)
471
float32 ret = int32_to_float32(t0, &env->fp_status);
472
return *(uint32_t*)(&ret);
475
uint64_t helper_float_DT(uint32_t t0)
477
float64 ret = int32_to_float64(t0, &env->fp_status);
478
return *(uint64_t*)(&ret);
481
uint32_t helper_fmul_FT(uint32_t t0, uint32_t t1)
483
float32 ret = float32_mul(*(float32*)&t0, *(float32*)&t1, &env->fp_status);
484
return *(uint32_t*)(&ret);
487
uint64_t helper_fmul_DT(uint64_t t0, uint64_t t1)
489
float64 ret = float64_mul(*(float64*)&t0, *(float64*)&t1, &env->fp_status);
490
return *(uint64_t*)(&ret);
493
uint32_t helper_fneg_T(uint32_t t0)
495
float32 ret = float32_chs(*(float32*)&t0);
496
return *(uint32_t*)(&ret);
499
uint32_t helper_fsqrt_FT(uint32_t t0)
501
float32 ret = float32_sqrt(*(float32*)&t0, &env->fp_status);
502
return *(uint32_t*)(&ret);
505
uint64_t helper_fsqrt_DT(uint64_t t0)
507
float64 ret = float64_sqrt(*(float64*)&t0, &env->fp_status);
508
return *(uint64_t*)(&ret);
511
uint32_t helper_fsub_FT(uint32_t t0, uint32_t t1)
513
float32 ret = float32_sub(*(float32*)&t0, *(float32*)&t1, &env->fp_status);
514
return *(uint32_t*)(&ret);
517
uint64_t helper_fsub_DT(uint64_t t0, uint64_t t1)
519
float64 ret = float64_sub(*(float64*)&t0, *(float64*)&t1, &env->fp_status);
520
return *(uint64_t*)(&ret);
523
uint32_t helper_ftrc_FT(uint32_t t0)
525
return float32_to_int32_round_to_zero(*(float32*)&t0, &env->fp_status);
528
uint32_t helper_ftrc_DT(uint64_t t0)
530
return float64_to_int32_round_to_zero(*(float64*)&t0, &env->fp_status);
345
void helper_rotcl(uint32_t * addr)
349
new = (*addr << 1) | (env->sr & SR_T);
350
if (*addr & 0x80000000)
357
void helper_rotcr(uint32_t * addr)
361
new = (*addr >> 1) | ((env->sr & SR_T) ? 0x80000000 : 0);