Lines Matching +full:- +full:- +full:-
4 * Copyright (c) 2003-2005 Fabrice Bellard
21 #include "qemu/main-loop.h"
23 #include "exec/helper-proto.h"
29 if (env->cwp == env->nwindows - 1) { in cpu_set_cwp()
30 memcpy(env->regbase, env->regbase + env->nwindows * 16, in cpu_set_cwp()
31 sizeof(env->gregs)); in cpu_set_cwp()
33 env->cwp = new_cwp; in cpu_set_cwp()
36 if (new_cwp == env->nwindows - 1) { in cpu_set_cwp()
37 memcpy(env->regbase + env->nwindows * 16, env->regbase, in cpu_set_cwp()
38 sizeof(env->gregs)); in cpu_set_cwp()
40 env->regwptr = env->regbase + (new_cwp * 16); in cpu_set_cwp()
47 icc |= ((int32_t)env->cc_N < 0) << PSR_NEG_SHIFT; in cpu_get_psr()
48 icc |= ((int32_t)env->cc_V < 0) << PSR_OVF_SHIFT; in cpu_get_psr()
49 icc |= ((int32_t)env->icc_Z == 0) << PSR_ZERO_SHIFT; in cpu_get_psr()
51 icc |= extract64(env->icc_C, 32, 1) << PSR_CARRY_SHIFT; in cpu_get_psr()
53 icc |= env->icc_C << PSR_CARRY_SHIFT; in cpu_get_psr()
57 return env->version | icc | in cpu_get_psr()
58 (env->psref ? PSR_EF : 0) | in cpu_get_psr()
59 (env->psrpil << 8) | in cpu_get_psr()
60 (env->psrs ? PSR_S : 0) | in cpu_get_psr()
61 (env->psrps ? PSR_PS : 0) | in cpu_get_psr()
62 (env->psret ? PSR_ET : 0) | env->cwp; in cpu_get_psr()
72 env->cc_N = deposit64(env->cc_N, 0, 32, -(val & PSR_NEG)); in cpu_put_psr_icc()
73 env->cc_V = deposit64(env->cc_V, 0, 32, -(val & PSR_OVF)); in cpu_put_psr_icc()
74 env->icc_C = -(val & PSR_CARRY); in cpu_put_psr_icc()
76 env->cc_N = -(val & PSR_NEG); in cpu_put_psr_icc()
77 env->cc_V = -(val & PSR_OVF); in cpu_put_psr_icc()
78 env->icc_C = (val >> PSR_CARRY_SHIFT) & 1; in cpu_put_psr_icc()
80 env->icc_Z = ~val & PSR_ZERO; in cpu_put_psr_icc()
87 env->psref = (val & PSR_EF) ? 1 : 0; in cpu_put_psr_raw()
88 env->psrpil = (val & PSR_PIL) >> 8; in cpu_put_psr_raw()
89 env->psrs = (val & PSR_S) ? 1 : 0; in cpu_put_psr_raw()
90 env->psrps = (val & PSR_PS) ? 1 : 0; in cpu_put_psr_raw()
91 env->psret = (val & PSR_ET) ? 1 : 0; in cpu_put_psr_raw()
109 if (unlikely(cwp >= env->nwindows)) { in cpu_cwp_inc()
110 cwp -= env->nwindows; in cpu_cwp_inc()
118 cwp += env->nwindows; in cpu_cwp_dec()
128 if (env->psret == 1) { in helper_rett()
132 env->psret = 1; in helper_rett()
133 cwp = cpu_cwp_inc(env, env->cwp + 1) ; in helper_rett()
134 if (env->wim & (1 << cwp)) { in helper_rett()
138 env->psrs = env->psrps; in helper_rett()
147 cwp = cpu_cwp_dec(env, env->cwp - 1); in helper_save()
148 if (env->wim & (1 << cwp)) { in helper_save()
158 cwp = cpu_cwp_inc(env, env->cwp + 1); in helper_restore()
159 if (env->wim & (1 << cwp)) { in helper_restore()
167 if ((new_psr & PSR_CWP) >= env->nwindows) { in helper_wrpsr()
189 cwp = cpu_cwp_dec(env, env->cwp - 1); in helper_save()
190 if (env->cansave == 0) { in helper_save()
191 int tt = TT_SPILL | (env->otherwin != 0 in helper_save()
192 ? (TT_WOTHER | ((env->wstate & 0x38) >> 1)) in helper_save()
193 : ((env->wstate & 0x7) << 2)); in helper_save()
196 if (env->cleanwin - env->canrestore == 0) { in helper_save()
200 env->cansave--; in helper_save()
201 env->canrestore++; in helper_save()
211 cwp = cpu_cwp_inc(env, env->cwp + 1); in helper_restore()
212 if (env->canrestore == 0) { in helper_restore()
213 int tt = TT_FILL | (env->otherwin != 0 in helper_restore()
214 ? (TT_WOTHER | ((env->wstate & 0x38) >> 1)) in helper_restore()
215 : ((env->wstate & 0x7) << 2)); in helper_restore()
218 env->cansave++; in helper_restore()
219 env->canrestore--; in helper_restore()
226 if (env->cansave != env->nwindows - 2) { in helper_flushw()
227 int tt = TT_SPILL | (env->otherwin != 0 in helper_flushw()
228 ? (TT_WOTHER | ((env->wstate & 0x38) >> 1)) in helper_flushw()
229 : ((env->wstate & 0x7) << 2)); in helper_flushw()
236 env->cansave++; in helper_saved()
237 if (env->otherwin == 0) { in helper_saved()
238 env->canrestore--; in helper_saved()
240 env->otherwin--; in helper_saved()
246 env->canrestore++; in helper_restored()
247 if (env->cleanwin < env->nwindows - 1) { in helper_restored()
248 env->cleanwin++; in helper_restored()
250 if (env->otherwin == 0) { in helper_restored()
251 env->cansave--; in helper_restored()
253 env->otherwin--; in helper_restored()
261 ccr |= (env->icc_C >> 32) & 1; in cpu_get_ccr()
262 ccr |= ((int32_t)env->cc_V < 0) << 1; in cpu_get_ccr()
263 ccr |= ((int32_t)env->icc_Z == 0) << 2; in cpu_get_ccr()
264 ccr |= ((int32_t)env->cc_N < 0) << 3; in cpu_get_ccr()
266 ccr |= env->xcc_C << 4; in cpu_get_ccr()
267 ccr |= (env->cc_V < 0) << 5; in cpu_get_ccr()
268 ccr |= (env->xcc_Z == 0) << 6; in cpu_get_ccr()
269 ccr |= (env->cc_N < 0) << 7; in cpu_get_ccr()
276 env->cc_N = deposit64(-(val & 0x08), 32, 32, -(val & 0x80)); in cpu_put_ccr()
277 env->cc_V = deposit64(-(val & 0x02), 32, 32, -(val & 0x20)); in cpu_put_ccr()
278 env->icc_C = (uint64_t)val << 32; in cpu_put_ccr()
279 env->xcc_C = (val >> 4) & 1; in cpu_put_ccr()
280 env->icc_Z = ~val & 0x04; in cpu_put_ccr()
281 env->xcc_Z = ~val & 0x40; in cpu_put_ccr()
286 return env->nwindows - 1 - env->cwp; in cpu_get_cwp64()
291 if (unlikely(cwp >= env->nwindows || cwp < 0)) { in cpu_put_cwp64()
292 cwp %= env->nwindows; in cpu_put_cwp64()
294 cpu_set_cwp(env, env->nwindows - 1 - cwp); in cpu_put_cwp64()
321 if (env->def.features & CPU_FEATURE_GL) { in get_gregset()
322 return env->glregs + (env->gl & 7) * 8; in get_gregset()
330 return env->bgregs; in get_gregset()
332 return env->agregs; in get_gregset()
334 return env->mgregs; in get_gregset()
336 return env->igregs; in get_gregset()
342 return env->glregs + (gl & 7) * 8; in get_gl_gregset()
350 dst = get_gl_gregset(env, env->gl); in cpu_gl_switch_gregs()
353 memcpy(dst, env->gregs, sizeof(env->gregs)); in cpu_gl_switch_gregs()
354 memcpy(env->gregs, src, sizeof(env->gregs)); in cpu_gl_switch_gregs()
361 env->gl = new_gl & 7; in helper_wrgl()
369 if (env->def.features & CPU_FEATURE_GL) { in cpu_change_pstate()
372 env->pstate = new_pstate; in cpu_change_pstate()
376 pstate_regs = env->pstate & 0xc01; in cpu_change_pstate()
385 memcpy(dst, env->gregs, sizeof(env->gregs)); in cpu_change_pstate()
386 memcpy(env->gregs, src, sizeof(env->gregs)); in cpu_change_pstate()
390 env->pstate = new_pstate; in cpu_change_pstate()
409 trace_win_helper_wrpil(env->psrpil, (uint32_t)new_pil); in helper_wrpil()
411 env->psrpil = new_pil; in helper_wrpil()
425 env->pc = tsptr->tnpc; in helper_done()
426 env->npc = tsptr->tnpc + 4; in helper_done()
427 cpu_put_ccr(env, tsptr->tstate >> 32); in helper_done()
428 env->asi = (tsptr->tstate >> 24) & 0xff; in helper_done()
429 cpu_change_pstate(env, (tsptr->tstate >> 8) & 0xf3f); in helper_done()
430 cpu_put_cwp64(env, tsptr->tstate & 0xff); in helper_done()
432 uint32_t new_gl = (tsptr->tstate >> 40) & 7; in helper_done()
433 env->hpstate = env->htstate[env->tl]; in helper_done()
435 env->gl = new_gl; in helper_done()
437 env->tl--; in helper_done()
439 trace_win_helper_done(env->tl); in helper_done()
454 env->pc = tsptr->tpc; in helper_retry()
455 env->npc = tsptr->tnpc; in helper_retry()
456 cpu_put_ccr(env, tsptr->tstate >> 32); in helper_retry()
457 env->asi = (tsptr->tstate >> 24) & 0xff; in helper_retry()
458 cpu_change_pstate(env, (tsptr->tstate >> 8) & 0xf3f); in helper_retry()
459 cpu_put_cwp64(env, tsptr->tstate & 0xff); in helper_retry()
461 uint32_t new_gl = (tsptr->tstate >> 40) & 7; in helper_retry()
462 env->hpstate = env->htstate[env->tl]; in helper_retry()
464 env->gl = new_gl; in helper_retry()
466 env->tl--; in helper_retry()
468 trace_win_helper_retry(env->tl); in helper_retry()