qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: khansa@kics.edu.pk
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, riku.voipio@iki.fi,
	Khansa Butt <khansa@kics.edu.pk>,
	aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 6/7] Addition of Cavium instructions in disassembler
Date: Tue, 27 Sep 2011 09:17:07 +0500	[thread overview]
Message-ID: <1317097027-23748-7-git-send-email-khansa@kics.edu.pk> (raw)
In-Reply-To: <1317097027-23748-1-git-send-email-khansa@kics.edu.pk>

From: Khansa Butt <khansa@kics.edu.pk>


Signed-off-by: Khansa Butt <khansa@kics.edu.pk>
---
 mips-dis.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/mips-dis.c b/mips-dis.c
index e3a6e0b..96ab1e8 100644
--- a/mips-dis.c
+++ b/mips-dis.c
@@ -300,6 +300,7 @@ struct mips_opcode
        Also used for immediate operands in vr5400 vector insns.
    "o" 16 bit signed offset (OP_*_DELTA)
    "p" 16 bit PC relative branch target address (OP_*_DELTA)
+   "+p" 5 bit unsigned constant describing bit position, for Octeon (OP_*_RT)
    "q" 10 bit extra breakpoint code (OP_*_CODE2)
    "r" 5 bit same register used as both source and target (OP_*_RS)
    "s" 5 bit source register specifier (OP_*_RS)
@@ -491,6 +492,13 @@ struct mips_opcode
 #define INSN_MULT                   0x40000000
 /* Instruction synchronize shared memory.  */
 #define INSN_SYNC		    0x80000000
+/* Load Cavium specific multiplier registers. */
+#define INSN_WRITE_MPL0             0x100000000
+#define INSN_WRITE_MPL1             0x200000000
+#define INSN_WRITE_MPL2             0x400000000
+#define INSN_WRITE_P0               0x800000000
+#define INSN_WRITE_P1               0x1000000000
+#define INSN_WRITE_P2               0x2000000000
 
 /* These are the bits which may be set in the pinfo2 field of an
    instruction. */
@@ -569,6 +577,8 @@ struct mips_opcode
 #define INSN_LOONGSON_2E          0x40000000
 /* ST Microelectronics Loongson 2F.  */
 #define INSN_LOONGSON_2F          0x80000000
+/* Cavium Network's Octeon processor */
+#define INSN_CVM_OCTEON           0x100000000
 
 /* MIPS ISA defines, use instead of hardcoding ISA level.  */
 
@@ -1099,6 +1109,13 @@ extern const int bfd_mips16_num_opcodes;
 #define RD_HI	INSN_READ_HI
 #define MOD_HI  WR_HI|RD_HI
 
+#define WR_MPL0 INSN_WRITE_MPL0
+#define WR_MPL1 INSN_WRITE_MPL1
+#define WR_MPL2 INSN_WRITE_MPL2
+#define WR_P0 INSN_WRITE_P0
+#define WR_P1 INSN_WRITE_P1
+#define WR_P2 INSN_WRITE_P2
+
 #define WR_LO	INSN_WRITE_LO
 #define RD_LO	INSN_READ_LO
 #define MOD_LO  WR_LO|RD_LO
@@ -1137,6 +1154,8 @@ extern const int bfd_mips16_num_opcodes;
 #define IL2E	(INSN_LOONGSON_2E)
 #define IL2F	(INSN_LOONGSON_2F)
 
+#define ICVM    (INSN_CVM_OCTEON)
+
 #define P3	INSN_4650
 #define L1	INSN_4010
 #define V1	(INSN_4100 | INSN_4111 | INSN_4120)
@@ -2435,6 +2454,34 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"cop1",     "C",	0,    (int) M_COP1,	INSN_MACRO,		0,		I1	},
 {"cop2",     "C",	0,    (int) M_COP2,	INSN_MACRO,		0,		I1	},
 {"cop3",     "C",	0,    (int) M_COP3,	INSN_MACRO,		0,		I1	},
+/* Cavium specific instructions */
+{"baddu",   "d,s,t",    0x70000028, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"dmul",    "d,s,t",    0x70000003, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"v3mulu",  "d,s,t",    0x70000011, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"vmm0",    "d,s,t",    0x70000010, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"vmulu",   "d,s,t",    0x7000000f, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"seq",     "d,s,t",    0x7000002a, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"seqi",   "t,r,j",     0x7000002e, 0xfc00003f,  WR_t|RD_s,     0,  ICVM    },
+{"sne",     "d,s,t",    0x7000002b, 0xfc0007ff, RD_s|RD_t|WR_d, 0,  ICVM    },
+{"snei",    "t,r,j",    0x7000002f, 0xfc00003f, WR_t|RD_s,      0,  ICVM    },
+{"bbit0",    "s,+p,p",   0xc8000000,     0xfc000000, CBD|RD_s,  0,  ICVM    },
+{"bbit032",    "s,+p,p",   0xd8000000,     0xfc000000, CBD|RD_s, 0, ICVM    },
+{"bbit1",    "s,+p,p",   0xe8000000,     0xfc000000, CBD|RD_s,   0, ICVM    },
+{"bbit132",    "s,+p,p",   0xf8000000,     0xfc000000, CBD|RD_s, 0, ICVM    },
+{"saa",    "t,(b)", 0x70000018, 0xfc00ffff, SM|RD_t|RD_b,        0, ICVM    },
+{"saad",   "t,(b)", 0x70000019, 0xfc00ffff, SM|RD_t|RD_b,        0, ICVM    },
+{"exts",   "t,r,+A,+C", 0x7000003a, 0xfc00003f, WR_t|RD_s,       0, ICVM    },
+{"exts32", "t,r,+A,+C", 0x7c00003b, 0xfc00003f, WR_t|RD_s,       0, ICVM    },
+{"cins",   "t,r,+A,+B", 0x70000032, 0xfc00003f, WR_t|RD_s,       0, ICVM    },
+{"cins32", "t,r,+A,+B", 0x70000033, 0xfc00003f, WR_t|RD_s,       0, ICVM    },
+{"mtm0",    "s",    0x70000008, 0xfc1fffff, RD_s|WR_MPL0,   0,      ICVM    },
+{"mtm1",    "s",    0x7000000c, 0xfc1fffff, RD_s|WR_MPL1,   0,      ICVM    },
+{"mtm2",    "s",    0x7000000d, 0xfc1fffff, RD_s|WR_MPL2,   0,      ICVM    },
+{"mtp0",    "s",    0x70000009, 0xfc1fffff, RD_s|WR_P0,     0,      ICVM    },
+{"mtp1",    "s",    0x7000000a, 0xfc1fffff, RD_s|WR_P1,     0,      ICVM    },
+{"mtp2",    "s",    0x7000000b, 0xfc1fffff, RD_s|WR_P2,     0,      ICVM    },
+{"dpop",    "d,s",  0x7000002d, 0xfc1f07ff, RD_s|WR_d,  0,          ICVM    },
+{"pop",     "d,s",  0x7000002c, 0xfc1f07ff, RD_s|WR_d,  0,          ICVM    },
   /* Conflicts with the 4650's "mul" instruction.  Nobody's using the
      4010 any more, so move this insn out of the way.  If the object
      format gave us more info, we could do this right.  */
@@ -3603,6 +3650,12 @@ print_insn_args (const char *d,
 		break;
 	      }
 
+        case 'p':
+            /* Cavium specific 5 bit value describing bit position. */
+            (*info->fprintf_func) (info->stream, "0x%x",
+                       (unsigned int)(l >> OP_SH_RT) & OP_MASK_RT);
+            break;
+
 	    default:
 	      /* xgettext:c-format */
 	      (*info->fprintf_func) (info->stream,
-- 
1.7.3.4

      parent reply	other threads:[~2011-09-27  4:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27  4:17 [Qemu-devel] [PATCH 0/7] MIPS64 user mode emulation in QEMU with Cavium specific instruction support khansa
2011-09-27  4:17 ` [Qemu-devel] [PATCH 1/7] linux-user:Support for MIPS64 user mode emulation in QEMU khansa
2011-09-27  4:17 ` [Qemu-devel] [PATCH 2/7] target-mips:enabling of 64 bit user mode and floating point operations khansa
2011-09-27  4:17 ` [Qemu-devel] [PATCH 3/7] linux-user:Signal handling for MIPS64 khansa
2011-09-27  4:17 ` [Qemu-devel] [PATCH 4/7] target-mips:Octeon cpu definition khansa
2011-09-27  4:17 ` [Qemu-devel] [PATCH 5/7] target-mips:Support for Cavium specific instructions khansa
2011-09-27 15:14   ` Richard Henderson
2011-09-28  8:29   ` Andreas Färber
2011-09-27  4:17 ` khansa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317097027-23748-7-git-send-email-khansa@kics.edu.pk \
    --to=khansa@kics.edu.pk \
    --cc=aurelien@aurel32.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).