target/arm: Convert SVC

Backports commit 542f5188a14758d64f7504580a9bd3cae973f546 from qemu
This commit is contained in:
Richard Henderson 2019-11-20 11:31:47 -05:00 committed by Lioncash
parent a119870e57
commit 87ff6a8bdf
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 17 additions and 6 deletions

View file

@ -528,3 +528,7 @@ LDM_a32 ---- 100 b:1 i:1 u:1 w:1 1 rn:4 list:16 &ldst_block
B .... 1010 ........................ @branch
BL .... 1011 ........................ @branch
# Supervisor call
SVC ---- 1111 imm:24 &i

View file

@ -10417,6 +10417,18 @@ static bool trans_BLX_i(DisasContext *s, arg_BLX_i *a)
return true;
}
/*
* Supervisor call
*/
static bool trans_SVC(DisasContext *s, arg_SVC *a)
{
gen_set_pc_im(s, s->base.pc_next);
s->svc_imm = a->imm;
s->base.is_jmp = DISAS_SWI;
return true;
}
/*
* Legacy decoder.
*/
@ -10695,6 +10707,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
case 0x09:
case 0xa:
case 0xb:
case 0xf:
/* All done in decodetree. Reach here for illegal ops. */
goto illegal_op;
case 0xc:
@ -10710,12 +10723,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
goto illegal_op;
}
break;
case 0xf:
/* swi */
gen_set_pc_im(s, s->base.pc_next);
s->svc_imm = extract32(insn, 0, 24);
s->base.is_jmp = DISAS_SWI;
break;
default:
illegal_op:
unallocated_encoding(s);