From: leif.lindholm@arm.com (Leif Lindholm)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v6)
Date: Mon, 2 Aug 2010 19:45:27 +0100 [thread overview]
Message-ID: <000001cb3272$e8b64130$ba22c390$@lindholm@arm.com> (raw)
In-Reply-To: <20100731112916.GN23886@n2100.arm.linux.org.uk>
> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
> Sent: 31 July 2010 12:29
> First stab at merging these ARM ISA decoding macros/code - I'm sure
> there's more which can be done:
>
> diff --git a/arch/arm/include/asm/arm-isa.h b/arch/arm/include/asm/arm-
> isa.h
> index e69de29..aad7dd3 100644
> --- a/arch/arm/include/asm/arm-isa.h
> +++ b/arch/arm/include/asm/arm-isa.h
> +#define RN_BITS(i) (((i) >> 16) & 15) /* Rn */
> +#define RD_BITS(i) (((i) >> 12) & 15) /* Rd */
> +#define RM_BITS(i) ((i) & 15) /* Rm
*/
While I could bring the SWP emulation patch in line by just adding a
couple of defines here for RT_BITS and RT2_BITS, unfortunately, the
ARM instruction formats aren't 100% consistent about these offsets:
STREX* have their Rn and Rd fields at the same offsets as above, with
an Rt field at offset 0.
| | | | Rn | Rd | | | Rt |
SWP/SWPB have Rt at offset 12 with an Rt2 at offset 0.
| | | | Rn | Rt | | | Rt2|
STRD likewise has Rt at offset 12, but with an Rm at 0.
| | | | Rn | Rt | | | Rm |
ASR has Rd at offset 12, but with Rm at 8 and Rn at 0.
| | | | | Rd | Rm | | Rn |
MLA has Rd at 16, with Ra at 12, Rm at 8 and Rn at 0.
| | | | Rd | Ra | Rm | | Rn |
So in the long run we would either need to implement an instruction
decoder to extract the offsets of fields, or separate the least common
ones out into separate defines. The former having potential negative
impact on code size and performance.
If you'd like, I could update the SWP emulation patch to set up
separate SWP_RT_BITS and SWP_RT2_BITS in arm-isa.h for now, along with
a couple of other things I would need. At least that would gather the
encoding stuff into one file.
/
Leif
next prev parent reply other threads:[~2010-08-02 18:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-19 18:02 [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v6) Leif Lindholm
2010-07-19 19:49 ` Kirill A. Shutemov
2010-07-19 20:02 ` Linus Walleij
2010-07-19 21:26 ` Kirill A. Shutemov
2010-07-28 6:06 ` Pavel Machek
2010-07-29 10:13 ` Siarhei Siamashka
2010-07-29 19:28 ` Pavel Machek
2010-07-30 10:04 ` Siarhei Siamashka
2010-07-31 10:52 ` Russell King - ARM Linux
2010-07-31 11:29 ` Russell King - ARM Linux
2010-08-02 18:45 ` Leif Lindholm [this message]
2010-08-03 19:42 ` Jamie Lokier
2010-07-20 9:12 ` Catalin Marinas
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='000001cb3272$e8b64130$ba22c390$@lindholm@arm.com' \
--to=leif.lindholm@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).