> +static inline __u64 ___swab16(__u64 x)
> +{
> + return (__u64)((x & (__u64)0x00ffULL) << 56) |
> + (__u64)((x & (__u64)0xff00ULL) << 40) |
> + (__u64)((x & (__u64)0x00ffULL) << 24) |
> + (__u64)((x & (__u64)0x
Martin Dalecki <[EMAIL PROTECTED]> said:
> Andrea Arcangeli wrote:
> > On Wed, Sep 20, 2000 at 01:22:50AM +0200, Andi Kleen wrote:
> > > Better would be to use statement blocks like
> > > #define bla(x) ({ __u32 tmp__ = (x); ; tmp__; })
> > Agreed.
> Not agreed. In this case older version of
> +static inline __u64 ___swab16(__u64 x)
> +{
> + return (__u64)((x & (__u64)0x00ffULL) << 56) |
> + (__u64)((x & (__u64)0xff00ULL) << 40) |
> + (__u64)((x & (__u64)0x00ffULL) << 24) |
> + (__u64)((x & (__u64)0xf
> " " == Alexander Viro <[EMAIL PROTECTED]> writes:
> Nice spotting, but bad fix, IMO. swab...() stuff is a perfect
> example of the dangerous use of macros. BTW, 2.4 has the same
> problem.
> +static inline __u16 ___swab16(__u16 x) +{
Don't forget that htonl(), ntohl(),
On Tue, Sep 19, 2000 at 04:11:30PM -0700, David S. Miller wrote:
> Unfortunately, gcc does not make inline functions as cheap as "macros
> with type checking". There are extra costs and often the register
> allocator cannot cope and stuff starts getting spilled to the stack.
It is supposedly on
On Wed, Sep 20, 2000 at 01:58:32AM +0200, Martin Dalecki wrote:
> Andrea Arcangeli wrote:
> >
> > On Wed, Sep 20, 2000 at 01:22:50AM +0200, Andi Kleen wrote:
> > > Better would be to use statement blocks like
> > > #define bla(x) ({ __u32 tmp__ = (x); ; tmp__; })
> >
> > Agreed.
>
> Not agr
On Wed, Sep 20, 2000 at 01:55:58AM +0200, Martin Dalecki wrote:
> The GCC manual doesn't lie on that ANY LONGER with respect to EGCS.
> And we should adpat for the modern versions of the compiler instead
> of dragging the *ugly* code with us until the earth stops spinning, iff
> the only concern i
On Wed, Sep 20, 2000 at 01:58:32AM +0200, Martin Dalecki wrote:
> Not agreed. In this case older version of GCC will have
> almost exactly the same provlems as with functions.
I guess the object was to remove the mistake-prone side effects anyway...
Andrea
-
To unsubscribe from this list: send t
Date: Wed, 20 Sep 2000 01:58:32 +0200
From: Martin Dalecki <[EMAIL PROTECTED]>
Andrea Arcangeli wrote:
> Agreed.
Not agreed. In this case older version of GCC will have
almost exactly the same provlems as with functions.
Care to show an example? I do not believe this is true.
Andrea Arcangeli wrote:
>
> On Wed, Sep 20, 2000 at 01:22:50AM +0200, Andi Kleen wrote:
> > Better would be to use statement blocks like
> > #define bla(x) ({ __u32 tmp__ = (x); ; tmp__; })
>
> Agreed.
Not agreed. In this case older version of GCC will have
almost exactly the same provlems
On Tue, 19 Sep 2000, Linus Torvalds wrote:
>
>
> On Tue, 19 Sep 2000, David S. Miller wrote:
> >
> > Would you mind taking a look at the difference in code output when
> > register pressure in a given function is moderate to high? :-)
>
> Immaterial.
>
> If somebody cares about performanc
Andi Kleen wrote:
>
> On Tue, Sep 19, 2000 at 07:13:31PM -0400, Alexander Viro wrote:
> > Nice spotting, but bad fix, IMO. swab...() stuff is a perfect example of
> > the dangerous use of macros. BTW, 2.4 has the same problem.
>
> inlines usually generate worse code than macros (the gcc manual l
On Wed, 20 Sep 2000, Andrea Arcangeli wrote:
> On Tue, Sep 19, 2000 at 07:13:31PM -0400, Alexander Viro wrote:
> > +static inline __u16 ___swab16(__u16 x)
> > +{
> > + return ((x & (__u16)0x00ffU) << 8) | ((x & (__u16)0xff00U) >> 8);
> > +}
> > +static inline __u32 ___swab16(__u32 x)
>
On Wed, 20 Sep 2000, Andi Kleen wrote:
> On Tue, Sep 19, 2000 at 07:13:31PM -0400, Alexander Viro wrote:
> > Nice spotting, but bad fix, IMO. swab...() stuff is a perfect example of
> > the dangerous use of macros. BTW, 2.4 has the same problem.
>
> inlines usually generate worse code than mac
On Wed, Sep 20, 2000 at 01:22:50AM +0200, Andi Kleen wrote:
> Better would be to use statement blocks like
> #define bla(x) ({ __u32 tmp__ = (x); ; tmp__; })
Agreed.
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED
On Tue, Sep 19, 2000 at 07:13:31PM -0400, Alexander Viro wrote:
> +static inline __u16 ___swab16(__u16 x)
> +{
> + return ((x & (__u16)0x00ffU) << 8) | ((x & (__u16)0xff00U) >> 8);
> +}
> +static inline __u32 ___swab16(__u32 x)
^
> +{
> + return ((x & (__u32
On Tue, 19 Sep 2000, David S. Miller wrote:
>
> Would you mind taking a look at the difference in code output when
> register pressure in a given function is moderate to high? :-)
Immaterial.
If somebody cares about performance, they'd just better create the proper
architecture-specific macr
Date:Tue, 19 Sep 2000 19:13:31 -0400 (EDT)
From: Alexander Viro <[EMAIL PROTECTED]>
Nice spotting, but bad fix, IMO. swab...() stuff is a perfect
example of the dangerous use of macros. BTW, 2.4 has the same
problem.
Would you mind taking a look at the difference in code o
On Tue, Sep 19, 2000 at 07:13:31PM -0400, Alexander Viro wrote:
> Nice spotting, but bad fix, IMO. swab...() stuff is a perfect example of
> the dangerous use of macros. BTW, 2.4 has the same problem.
inlines usually generate worse code than macros (the gcc manual lies on that),
e.g. the register
On Tue, 19 Sep 2000, David S. Miller wrote:
>Date: Wed, 20 Sep 2000 00:50:06 +0200
>From: "Andi Kleen" <[EMAIL PROTECTED]>
>
>This patch fixes an obvious bug introduced with the ext2 changes in
>2.2.18pre (look up the definition of le32_to_cpu on BE machines
>without a
20 matches
Mail list logo