Skip to content

Commit

Permalink
target/arm: Convert SETEND
Browse files Browse the repository at this point in the history
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-38-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
rth7680 authored and pm215 committed Sep 5, 2019
1 parent 52f83b9 commit 48c04a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions target/arm/a32-uncond.decode
Expand Up @@ -24,6 +24,7 @@

&empty !extern
&i !extern imm
&setend E

# Branch with Link and Exchange

Expand All @@ -50,3 +51,6 @@ DSB 1111 0101 0111 1111 1111 0000 0100 ----
DMB 1111 0101 0111 1111 1111 0000 0101 ----
ISB 1111 0101 0111 1111 1111 0000 0110 ----
SB 1111 0101 0111 1111 1111 0000 0111 0000

# Set Endianness
SETEND 1111 0001 0000 0001 0000 00 E:1 0 0000 0000 &setend
22 changes: 13 additions & 9 deletions target/arm/translate.c
Expand Up @@ -10240,6 +10240,18 @@ static bool trans_SB(DisasContext *s, arg_SB *a)
return true;
}

static bool trans_SETEND(DisasContext *s, arg_SETEND *a)
{
if (!ENABLE_ARCH_6) {
return false;
}
if (a->E != (s->be_data == MO_BE)) {
gen_helper_setend(cpu_env);
s->base.is_jmp = DISAS_UPDATE;
}
return true;
}

/*
* Legacy decoder.
*/
Expand Down Expand Up @@ -10325,15 +10337,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
return; /* v7MP: Unallocated memory hint: must NOP */
}

if ((insn & 0x0ffffdff) == 0x01010000) {
ARCH(6);
/* setend */
if (((insn >> 9) & 1) != !!(s->be_data == MO_BE)) {
gen_helper_setend(cpu_env);
s->base.is_jmp = DISAS_UPDATE;
}
return;
} else if ((insn & 0x0e000f00) == 0x0c000100) {
if ((insn & 0x0e000f00) == 0x0c000100) {
if (arm_dc_feature(s, ARM_FEATURE_IWMMXT)) {
/* iWMMXt register transfer. */
if (extract32(s->c15_cpar, 1, 1)) {
Expand Down

0 comments on commit 48c04a5

Please sign in to comment.