]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/xtensa: implement DIWBUI.P opcode
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 14 Apr 2019 21:02:17 +0000 (14:02 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 14 May 2019 20:19:35 +0000 (13:19 -0700)
This is a recent addition to the set of data cache opcodes.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target/xtensa/cpu.h
target/xtensa/overlay_tool.h
target/xtensa/translate.c

index d6e6bf6ca1837c9eba7c923b96a4531e6d40500e..ba4ef2b6a729b21f45a8e3a949f4a0d8a4a8168c 100644 (file)
@@ -466,6 +466,7 @@ struct XtensaConfig {
 
     unsigned icache_ways;
     unsigned dcache_ways;
+    unsigned dcache_line_bytes;
     uint32_t memctl_mask;
 
     XtensaMemory instrom;
index b61c925398612dcf6a25d1fc2cf69c26415be763..4925b21f0edfcdc6de53d59ac0f29581890bfaca 100644 (file)
 #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 ? \
index 782f2ec62099d3b17bb5ec0ee145b20a9047b671..24eb70d619d51400b86abd5e6bbaad1688a1ff2c 100644 (file)
@@ -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[])
 {
@@ -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,