qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net, anthony@codemonkey.ws
Subject: [Qemu-devel] [PULL 15/17] tcg: Add TCGMemOp
Date: Thu, 10 Oct 2013 14:28:43 -0700	[thread overview]
Message-ID: <1381440525-6666-16-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1381440525-6666-1-git-send-email-rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 7d0c652..db0abc3 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -197,6 +197,60 @@ typedef enum TCGType {
 #endif
 } TCGType;
 
+/* Constants for qemu_ld and qemu_st for the Memory Operation field.  */
+typedef enum TCGMemOp {
+    MO_8     = 0,
+    MO_16    = 1,
+    MO_32    = 2,
+    MO_64    = 3,
+    MO_SIZE  = 3,   /* Mask for the above.  */
+
+    MO_SIGN  = 4,   /* Sign-extended, otherwise zero-extended.  */
+
+    MO_BSWAP = 8,   /* Host reverse endian.  */
+#ifdef HOST_WORDS_BIGENDIAN
+    MO_LE    = MO_BSWAP,
+    MO_BE    = 0,
+#else
+    MO_LE    = 0,
+    MO_BE    = MO_BSWAP,
+#endif
+#ifdef TARGET_WORDS_BIGENDIAN
+    MO_TE    = MO_BE,
+#else
+    MO_TE    = MO_LE,
+#endif
+
+    /* Combinations of the above, for ease of use.  */
+    MO_UB    = MO_8,
+    MO_UW    = MO_16,
+    MO_UL    = MO_32,
+    MO_SB    = MO_SIGN | MO_8,
+    MO_SW    = MO_SIGN | MO_16,
+    MO_SL    = MO_SIGN | MO_32,
+    MO_Q     = MO_64,
+
+    MO_LEUW  = MO_LE | MO_UW,
+    MO_LEUL  = MO_LE | MO_UL,
+    MO_LESW  = MO_LE | MO_SW,
+    MO_LESL  = MO_LE | MO_SL,
+    MO_LEQ   = MO_LE | MO_Q,
+
+    MO_BEUW  = MO_BE | MO_UW,
+    MO_BEUL  = MO_BE | MO_UL,
+    MO_BESW  = MO_BE | MO_SW,
+    MO_BESL  = MO_BE | MO_SL,
+    MO_BEQ   = MO_BE | MO_Q,
+
+    MO_TEUW  = MO_TE | MO_UW,
+    MO_TEUL  = MO_TE | MO_UL,
+    MO_TESW  = MO_TE | MO_SW,
+    MO_TESL  = MO_TE | MO_SL,
+    MO_TEQ   = MO_TE | MO_Q,
+
+    MO_SSIZE = MO_SIZE | MO_SIGN,
+} TCGMemOp;
+
 typedef tcg_target_ulong TCGArg;
 
 /* Define a type and accessor macros for variables.  Using a struct is
-- 
1.8.1.4

  parent reply	other threads:[~2013-10-10 21:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 21:28 [Qemu-devel] [PULL 00/17] TCG 2013-10-10 Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 01/17] tcg-hppa: Remove tcg backend Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 02/17] tcg: Delete tcg_helper_get_name declaration Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 03/17] tcg: Use a GHashTable for tcg_find_helper Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 04/17] target-m68k: Rename helpers.h to helper.h Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 05/17] tcg: Move helper registration into tcg_context_init Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 06/17] tcg: Remove stray semi-colons from target-*/helper.h Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 07/17] tcg: Put target helper data into an array Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 08/17] tcg: Add tcg-runtime.c helpers to all_helpers Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 09/17] tcg: Merge tcg_register_helper into tcg_context_init Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 10/17] tcg-aarch64: Update to helper_ret_*_mmu routines Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 11/17] exec: Delete is_tcg_gen_code and GETRA_EXT Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 12/17] tcg: Add tcg-be-null.h Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 13/17] tcg: Add tcg-be-ldst.h Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 14/17] configure: Remove CONFIG_QEMU_LDST_OPTIMIZATION Richard Henderson
2013-10-10 21:28 ` Richard Henderson [this message]
2013-10-10 21:28 ` [Qemu-devel] [PULL 16/17] tcg: Add qemu_ld_st_i32/64 Richard Henderson
2013-10-10 21:28 ` [Qemu-devel] [PULL 17/17] exec: Add both big- and little-endian memory helpers Richard Henderson

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=1381440525-6666-16-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=anthony@codemonkey.ws \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /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).