target-arm: Implement YIELD insn to yield in ARM and Thumb translators

Implement the YIELD instruction in the ARM and Thumb translators to
actually yield control back to the top level loop rather than being
a simple no-op. (We already do this for A64.)

Backports commit c87e5a61c2b3024116f52f7e68273f864ff7ab82 from qemu
This commit is contained in:
Peter Maydell 2018-02-14 02:05:44 -05:00 committed by Lioncash
parent 8840d8370d
commit 5c7389680e
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -4221,6 +4221,10 @@ static void gen_rfe(DisasContext *s, TCGv_i32 pc, TCGv_i32 cpsr)
static void gen_nop_hint(DisasContext *s, int val)
{
switch (val) {
case 1: /* yield */
gen_set_pc_im(s, s->pc);
s->is_jmp = DISAS_YIELD;
break;
case 3: /* wfi */
gen_set_pc_im(s, s->pc);
s->is_jmp = DISAS_WFI;
@ -11699,6 +11703,9 @@ tb_end:
case DISAS_WFE:
gen_helper_wfe(tcg_ctx, tcg_ctx->cpu_env);
break;
case DISAS_YIELD:
gen_helper_yield(tcg_ctx, tcg_ctx->cpu_env);
break;
case DISAS_SWI:
gen_exception(dc, EXCP_SWI, syn_aa32_svc(dc->svc_imm, dc->thumb),
default_exception_el(dc));