All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation
Date: Fri, 7 Jan 2011 23:10:17 +0000	[thread overview]
Message-ID: <AANLkTi=s6c83B6v+rS-H_8J-B2xqyq_BUo3Qnzv_-swP@mail.gmail.com> (raw)
In-Reply-To: <1294440183-885-1-git-send-email-rth@twiddle.net>

On 7 January 2011 22:42, Richard Henderson <rth@twiddle.net> wrote:
> Emulating i386 -- particularly in 16-bit mode -- requires quite a few
> bitfield insert operations, to handle byte and word stores into the
> dword registers.  On several hosts, this can be done natively, without
> resorting to a sequence of and and or instructions.

+* deposit_i32/i64 dest, t1, t2, loc
+
+Deposit T2 as a bitfield into T1, placing the result in DEST.
+The bitfield is described by LOC, an immediate value:
+
+  bits 0:7  - the length of the bitfield
+  bits 8:15 - the position of the first bit
+
+For example, 0x101 indicates a 1-bit field at bit 1.
+This operation would be equivalent to
+
+  dest = (t1 & ~2) | ((t2 << 1) & 2)

Unless I've missed something, deposit_i32 is basically the same
as the ARM BFI instruction, so for ARM we could use deposit_i32 in
the implementation of BFI (and conversely implement deposit_i32
using BFI when we're generating for an ARMv6T2 or better host.)

-- PMM

  parent reply	other threads:[~2011-01-07 23:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 22:42 [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation Richard Henderson
2011-01-07 22:42 ` [Qemu-devel] [PATCH 1/7] tcg: Define "deposit" as an optional operation Richard Henderson
2011-01-07 23:48   ` Stuart Brady
2011-01-09 21:38   ` Aurelien Jarno
2011-01-09 22:45     ` Richard Henderson
2011-01-07 22:42 ` [Qemu-devel] [PATCH 2/7] tcg-ppc: Implement deposit operation Richard Henderson
2011-01-07 23:33   ` [Qemu-devel] " malc
2011-01-07 22:42 ` [Qemu-devel] [PATCH 3/7] tcg-hppa: " Richard Henderson
2011-01-07 23:35   ` Stuart Brady
2011-01-07 23:41     ` Richard Henderson
2011-01-07 22:43 ` [Qemu-devel] [PATCH 4/7] tcg-ia64: " Richard Henderson
2011-01-09 22:04   ` [Qemu-devel] " Aurelien Jarno
2011-01-07 22:43 ` [Qemu-devel] [PATCH 5/7] tcg-i386: " Richard Henderson
2011-01-09 21:53   ` [Qemu-devel] " Aurelien Jarno
2011-01-09 22:55     ` Richard Henderson
2011-01-10  0:16       ` Aurelien Jarno
2011-01-10  0:43         ` Richard Henderson
2011-01-10 16:52           ` Aurelien Jarno
2011-01-10 18:37       ` Aurelien Jarno
2011-01-10 19:19         ` Richard Henderson
2011-01-07 22:43 ` [Qemu-devel] [PATCH 6/7] target-i386: Use " Richard Henderson
2011-01-07 22:43 ` [Qemu-devel] [PATCH 7/7] target-ppc: " Richard Henderson
2011-01-07 23:10 ` Peter Maydell [this message]
2011-01-07 23:37   ` [Qemu-devel] [PATCH 0/7] Define "deposit" tcg operation 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='AANLkTi=s6c83B6v+rS-H_8J-B2xqyq_BUo3Qnzv_-swP@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.