From: Sergei Shtylyov <sshtylyov@mvista.com>
To: "Steven J. Hill" <sjhill@mips.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org,
cernekee@gmail.com, kevink@paralogos.com, ddaney.cavm@gmail.com
Subject: Re: [PATCH 4/4] MIPS: microMIPS: Add instruction utility macros.
Date: Wed, 06 Feb 2013 16:08:33 +0400 [thread overview]
Message-ID: <511247C1.2010401@mvista.com> (raw)
In-Reply-To: <1360104723-29529-5-git-send-email-sjhill@mips.com>
Hello.
On 06-02-2013 2:52, Steven J. Hill wrote:
> From: "Steven J. Hill" <sjhill@mips.com>
> Add two new macros for microMIPS. One checks if an exception was
> taken in either microMIPS or classic MIPS mode. The other checks
> if a microMIPS instruction is 16-bit or 32-bit in length.
> Signed-off-by: Steven J. Hill <sjhill@mips.com>
> ---
> arch/mips/include/asm/mipsregs.h | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
> diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
> index f206ef2..13e1d68 100644
> --- a/arch/mips/include/asm/mipsregs.h
> +++ b/arch/mips/include/asm/mipsregs.h
> @@ -622,6 +622,24 @@
> #ifndef __ASSEMBLY__
>
> /*
> + * Macros for handling the ISA mode bit for microMIPS.
> + */
> +#define get_isa16_mode(x) ((x) & 0x1)
> +#define msk_isa16_mode(x) ((x) & ~0x1)
> +#define set_isa16_mode(x) do { (x) |= 0x1; } while(0)
> +
> +/*
> + * microMIPS instructions can be 16-bit or 32-bit in length. This
> + * returns a 1 if the instruction is 16-bit and a 0 if 32-bit.
> + */
> +static inline int mm_insn_16bit(u16 insn)
> +{
> + u16 opcode = (insn >> 10) & 0x7;
> +
> + return ((opcode >= 1 && opcode <= 3) ? 1 : 0);
Parens are not really necessary there, are they?
WBR, Sergei
next prev parent reply other threads:[~2013-02-06 12:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-05 22:51 [PATCH 0/4] Add support for microMIPS instructions Steven J. Hill
2013-02-05 22:52 ` [PATCH 1/4] MIPS: microMIPS: Add instruction formats Steven J. Hill
2013-02-05 22:52 ` [PATCH 2/4] MIPS: microMIPS: uasm: Split 'uasm.c' into two files Steven J. Hill
2013-02-05 22:52 ` [PATCH 3/4] MIPS: microMIPS: uasm: Add microMIPS micro assembler support Steven J. Hill
2013-02-05 22:52 ` [PATCH 4/4] MIPS: microMIPS: Add instruction utility macros Steven J. Hill
2013-02-06 12:08 ` Sergei Shtylyov [this message]
2013-02-14 5:42 ` [PATCH 0/4] Add support for microMIPS instructions Steven Hill
2013-03-13 20:48 ` Ralf Baechle
2013-03-13 21:56 ` Steven J. Hill
2013-03-13 21:56 ` Steven J. Hill
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=511247C1.2010401@mvista.com \
--to=sshtylyov@mvista.com \
--cc=cernekee@gmail.com \
--cc=ddaney.cavm@gmail.com \
--cc=kevink@paralogos.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=sjhill@mips.com \
/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