From: Aurelien Jarno <aurelien@aurel32.net>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 5/8] target-mips: use DSP unions for binary DSP operators
Date: Thu, 10 Jan 2013 08:08:18 +0100 [thread overview]
Message-ID: <20130110070818.GA6400@ohm.aurel32.net> (raw)
In-Reply-To: <CAAu8pHsr0asBg7Yer4vSSazBdFpgp+niR+N5zx0WE9nP6tah0w@mail.gmail.com>
On Wed, Jan 09, 2013 at 09:16:29PM +0000, Blue Swirl wrote:
> On Wed, Jan 9, 2013 at 3:27 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > This allow to reduce the number of macros.
> >
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> > target-mips/dsp_helper.c | 384 ++++++++++++++--------------------------------
> > 1 file changed, 116 insertions(+), 268 deletions(-)
> >
> > diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c
> > index aed4c63..e01c8a9 100644
> > --- a/target-mips/dsp_helper.c
> > +++ b/target-mips/dsp_helper.c
> > @@ -1078,7 +1078,6 @@ static inline int32_t mipsdsp_cmpu_lt(uint32_t a, uint32_t b)
> > b = num & MIPSDSP_LO; \
> > } while (0)
> >
> > -#define MIPSDSP_RETURN32(a) ((target_long)(int32_t)a)
> > #define MIPSDSP_RETURN32_8(a, b, c, d) ((target_long)(int32_t) \
> > (((uint32_t)a << 24) | \
> > (((uint32_t)b << 16) | \
> > @@ -1111,119 +1110,127 @@ static inline int32_t mipsdsp_cmpu_lt(uint32_t a, uint32_t b)
> > #endif
> >
> > /** DSP Arithmetic Sub-class insns **/
> > -#define ARITH_PH(name, func) \
> > -target_ulong helper_##name##_ph(target_ulong rs, target_ulong rt) \
> > -{ \
> > - uint16_t rsh, rsl, rth, rtl, temph, templ; \
> > - \
> > - MIPSDSP_SPLIT32_16(rs, rsh, rsl); \
> > - MIPSDSP_SPLIT32_16(rt, rth, rtl); \
> > - \
> > - temph = mipsdsp_##func(rsh, rth); \
> > - templ = mipsdsp_##func(rsl, rtl); \
> > - \
> > - return MIPSDSP_RETURN32_16(temph, templ); \
> > -}
> > -
> > -#define ARITH_PH_ENV(name, func) \
> > -target_ulong helper_##name##_ph(target_ulong rs, target_ulong rt, \
> > - CPUMIPSState *env) \
> > -{ \
> > - uint16_t rsh, rsl, rth, rtl, temph, templ; \
> > - \
> > - MIPSDSP_SPLIT32_16(rs, rsh, rsl); \
> > - MIPSDSP_SPLIT32_16(rt, rth, rtl); \
> > - \
> > - temph = mipsdsp_##func(rsh, rth, env); \
> > - templ = mipsdsp_##func(rsl, rtl, env); \
> > - \
> > - return MIPSDSP_RETURN32_16(temph, templ); \
> > -}
> > -
> > -
> > -ARITH_PH_ENV(addq, add_i16);
> > -ARITH_PH_ENV(addq_s, sat_add_i16);
> > -ARITH_PH_ENV(addu, add_u16);
> > -ARITH_PH_ENV(addu_s, sat_add_u16);
> > -
> > -ARITH_PH(addqh, rshift1_add_q16);
> > -ARITH_PH(addqh_r, rrshift1_add_q16);
> > -
> > -ARITH_PH_ENV(subq, sub_i16);
> > -ARITH_PH_ENV(subq_s, sat16_sub);
> > -ARITH_PH_ENV(subu, sub_u16_u16);
> > -ARITH_PH_ENV(subu_s, satu16_sub_u16_u16);
> > -
> > -ARITH_PH(subqh, rshift1_sub_q16);
> > -ARITH_PH(subqh_r, rrshift1_sub_q16);
> > -
> > -#undef ARITH_PH
> > -#undef ARITH_PH_ENV
> > +#define MIPSDSP32_BINOP(name, func, element) \
> > +target_ulong helper_##name(target_ulong rs, target_ulong rt) \
> > +{ \
> > + DSP32Value ds, dt; \
> > + unsigned int i, n; \
> > + \
> > + n = sizeof(DSP32Value) / sizeof(ds.element[0]); \
> > + ds.sw[0] = rs; \
> > + dt.sw[0] = rt; \
> > + \
> > + for (i = 0 ; i < n ; i++) { \
>
> There's an extra space before ';', please remove. Also in the other
> for loops below.
It is not something I can find in CODING_STYLE, and it is also not
caught by checkpatch.pl.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2013-01-10 7:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 15:27 [Qemu-devel] [PATCH v2 0/8] target-mips: DSP ASE fixes and cleanup Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 1/8] target-mips: fix DSP loads with rd = 0 Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 2/8] target-mips: copy insn_flags in DisasContext Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 3/8] target-mips: generate a reserved instruction exception on CPU without DSP Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 4/8] target-mips: add unions to access DSP elements Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 5/8] target-mips: use DSP unions for binary DSP operators Aurelien Jarno
2013-01-09 21:16 ` Blue Swirl
2013-01-10 7:08 ` Aurelien Jarno [this message]
2013-01-12 10:39 ` Blue Swirl
2013-01-12 14:34 ` Aurelien Jarno
2013-01-12 15:08 ` Blue Swirl
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 6/8] target-mips: use DSP unions for unary " Aurelien Jarno
2013-01-09 21:17 ` Blue Swirl
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 7/8] target-mips: use DSP unions for reduction add instructions Aurelien Jarno
2013-01-09 21:18 ` Blue Swirl
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 8/8] target-mips: implement DSP (d)append sub-class with TCG Aurelien Jarno
2013-01-09 18:51 ` [Qemu-devel] [PATCH v2 0/8] target-mips: DSP ASE fixes and cleanup Richard Henderson
2013-01-09 21:19 ` Blue Swirl
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=20130110070818.GA6400@ohm.aurel32.net \
--to=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--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).