Skip to content

Commit

Permalink
target/xtensa: implement DIWBUI.P opcode
Browse files Browse the repository at this point in the history
This is a recent addition to the set of data cache opcodes.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
jcmvbkbc committed May 14, 2019
1 parent 4d04ea3 commit 75eed0e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions target/xtensa/cpu.h
Expand Up @@ -466,6 +466,7 @@ struct XtensaConfig {

unsigned icache_ways;
unsigned dcache_ways;
unsigned dcache_line_bytes;
uint32_t memctl_mask;

XtensaMemory instrom;
Expand Down
1 change: 1 addition & 0 deletions target/xtensa/overlay_tool.h
Expand Up @@ -425,6 +425,7 @@
#define CACHE_SECTION \
.icache_ways = XCHAL_ICACHE_WAYS, \
.dcache_ways = XCHAL_DCACHE_WAYS, \
.dcache_line_bytes = XCHAL_DCACHE_LINESIZE, \
.memctl_mask = \
(XCHAL_ICACHE_SIZE ? MEMCTL_IUSEWAYS_MASK : 0) | \
(XCHAL_DCACHE_SIZE ? \
Expand Down
10 changes: 10 additions & 0 deletions target/xtensa/translate.c
Expand Up @@ -1620,6 +1620,12 @@ static void translate_depbits(DisasContext *dc, const OpcodeArg arg[],
arg[2].imm, arg[3].imm);
}

static void translate_diwbuip(DisasContext *dc, const OpcodeArg arg[],
const uint32_t par[])
{
tcg_gen_addi_i32(arg[0].out, arg[0].in, dc->config->dcache_line_bytes);
}

static bool test_ill_entry(DisasContext *dc, const OpcodeArg arg[],
const uint32_t par[])
{
Expand Down Expand Up @@ -3097,6 +3103,10 @@ static const XtensaOpcodeOps core_ops[] = {
.name = "diwbi",
.translate = translate_nop,
.op_flags = XTENSA_OP_PRIVILEGED,
}, {
.name = "diwbui.p",
.translate = translate_diwbuip,
.op_flags = XTENSA_OP_PRIVILEGED,
}, {
.name = "dpfl",
.translate = translate_dcache,
Expand Down

0 comments on commit 75eed0e

Please sign in to comment.