mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nitin Gupta" <nitingupta910@gmail.com>
To: "Pekka Enberg" <penberg@cs.helsinki.fi>
Cc: linux-kernel@vger.kernel.org, "Richard Purdie" <richard@openedhand.com>
Subject: Re: [RFC] LZO1X de/compression support
Date: Tue, 22 May 2007 14:24:59 +0530	[thread overview]
Message-ID: <4cefeab80705220154k2b02a264id7774600087a80e5@mail.gmail.com> (raw)
In-Reply-To: <84144f020705180342j4ff44d96iea5b73c23a69df0f@mail.gmail.com>

Hi,

On 5/18/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> On 5/18/07, Nitin Gupta <nitingupta910@gmail.com> wrote:
> > +#define DX2(p,s1,s2) \
> > +       (((((size_t)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
> > +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
> > +#define DMUL(a,b)      ((size_t) ((a) * (b)))
> > +#define DMS(v,s)       ((size_t) (((v) & (D_MASK >> (s))) << (s)))
> > +#define DM(v)          DMS(v,0)
> > +
> > +#define D_BITS         14
> > +#define DINDEX1(d,p)   d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
> > +#define DINDEX2(d,p)   d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
> > +#define DENTRY(p,in)   (p)
>
> Please make these static inline functions.
>

What if compiler decides not to actully inline them? In that case
there will be significant perf. hit.

> > +#define PTR(a)         ((unsigned long) (a))
> > +#define PTR_LT(a,b)    (PTR(a) < PTR(b))
> > +#define PTR_GE(a,b)    (PTR(a) >= PTR(b))
> > +#define PTR_DIFF(a,b)  (PTR(a) - PTR(b))
> > +#define pd(a,b)                ((size_t) ((a)-(b)))
>
> [snip]
>
> > +#define COPY4(dst,src) *(uint32_t *)(dst) = *(uint32_t *)(src)
>
> Please drop these.
>

Done. Please see newer version posted.

Thanks for comments.

Cheers,
Nitin

  parent reply	other threads:[~2007-05-22  8:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18  9:58 Nitin Gupta
2007-05-18 10:14 ` Heikki Orsila
2007-05-18 11:27   ` Nitin Gupta
2007-05-18 11:53     ` Richard Purdie
2007-05-18 10:42 ` Pekka Enberg
2007-05-18 10:53   ` Pekka Enberg
2007-05-22  8:54   ` Nitin Gupta [this message]
2007-05-22  8:59     ` Pekka Enberg
2007-05-22  9:10       ` Nitin Gupta
2007-05-22  9:34         ` Pekka Enberg
2007-05-18 11:11 ` Andrey Panin
2007-05-22  9:08   ` Nitin Gupta
2007-05-22 19:44     ` Jan Engelhardt
2007-05-22 21:24     ` Bernd Petrovitsch
2007-05-23 16:35       ` Jeremy Fitzhardinge
2007-05-18 11:46 ` Richard Purdie
2007-05-22  9:19   ` Nitin Gupta
2007-05-18 20:04 ` Matt Mackall
2007-05-18 21:14 ` Krzysztof Halasa
2007-05-19 18:55   ` Bill Rugolsky Jr.
2007-05-19 21:52     ` Richard Purdie
2007-05-22 19:40 ` Jan Engelhardt
2007-05-19 18:12 devzero
2007-05-20 11:42 Tomasz Chmielewski

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=4cefeab80705220154k2b02a264id7774600087a80e5@mail.gmail.com \
    --to=nitingupta910@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=richard@openedhand.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

all inboxes | Powered by JetHome®