Re: __ucmpdi2

2000-09-22 Thread Linus Torvalds
In article <[EMAIL PROTECTED]>, Jeremy Higdon <[EMAIL PROTECTED]> wrote: > >In my case, it is simple "long long" arithmetic. Shifts, ANDs, ORs, >comparisons, etc. Not even any addition (which should be pretty efficient >with the HW carry bit on X86). I don't know why: Oh, I agree. In your cas

Re: __ucmpdi2

2000-09-20 Thread Jeremy Higdon
So I understand the point about filesystems and values that always happen to be a power of two where the compiler can't know that. However: > From: [EMAIL PROTECTED] (Linus Torvalds) > > >So what we've said is: 64 bit is okay, except in a switch statement, > >or other random expressions that mi

Re: __ucmpdi2

2000-09-20 Thread Linus Torvalds
In article <[EMAIL PROTECTED]>, Jeremy Higdon <[EMAIL PROTECTED]> wrote: >> - Linux developers often do horribly stupid things, and use 64-bit >>division etc instead of using a simple shift. Again, not linking >>against libgcc finds those things early rather than late, because the >>h

Re: __ucmpdi2

2000-09-20 Thread Peter Samuelson
[Jeremy Higdon] > Is there a little FAQ of C constructions you should not use if you > are writing kernel code? It took a little doing to figure out that > it was the switch that was causing trouble and not the shifts and > arithmetic operations, and I'd like to avoid that in the future :-). He

Re: __ucmpdi2

2000-09-20 Thread Peter Samuelson
[Cahalan] > Well, what do you care about most? The problem can be solved in > other, more disturbing ways. :-) For example, gcc's computed goto. [code snipped] You are sick. (: Peter - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PR

Re: __ucmpdi2

2000-09-20 Thread Albert D. Cahalan
Jeremy Higdon writes: > In reality, the switch does a 60 bit shift right, so I can cast to a > uint, which is the right thing to do on old architectures :-), solving > the problem. I had originally thought that the problem was in all the > masks, shifts, and compares, but they are all inlined.

Re: __ucmpdi2

2000-09-19 Thread Jeremy Higdon
On Sep 19, 8:39am, Richard Henderson wrote: > > On Tue, Sep 19, 2000 at 12:22:41PM +0200, Andreas Schwab wrote: > > IMHO it's a bug in gcc that it does not inline the comparison inside the > > switch expression, since it already does it in all other places. Perhaps > > some problem with the pat

Re: __ucmpdi2

2000-09-19 Thread Jeremy Higdon
> - Linux developers often do horribly stupid things, and use 64-bit >division etc instead of using a simple shift. Again, not linking >against libgcc finds those things early rather than late, because the >horribly stupid things end up requireing libgcc support. I would have thought

Re: __ucmpdi2

2000-09-19 Thread Jeff V. Merkey
Linus Torvalds wrote: > > I'd love to link against libgcc, but for the fact that > > - gcc developers have sometimes done horribly stupid things, and NOT >linking against libgcc has been an excellent way of not getting >bitten by it. Things like the exception handling etc, where not >

Re: __ucmpdi2

2000-09-19 Thread Linus Torvalds
In article <[EMAIL PROTECTED]>, Richard Henderson <[EMAIL PROTECTED]> wrote: >On Tue, Sep 19, 2000 at 12:22:41PM +0200, Andreas Schwab wrote: >> IMHO it's a bug in gcc that it does not inline the comparison inside the >> switch expression, since it already does it in all other places. Perhaps >>

Re: __ucmpdi2

2000-09-19 Thread Richard Henderson
On Tue, Sep 19, 2000 at 12:22:41PM +0200, Andreas Schwab wrote: > IMHO it's a bug in gcc that it does not inline the comparison inside the > switch expression, since it already does it in all other places. Perhaps > some problem with the patterns in the machine description. Perhaps, but without

Re: __ucmpdi2

2000-09-19 Thread Jeremy Higdon
On Sep 19, 1:08pm, Matti Aarnio wrote: > > On Tue, Sep 19, 2000 at 02:58:01AM -0700, Jeremy Higdon wrote: > > Hello, > > > > I'm using a 64 bit variable in a switch statement. Gcc is generating code > > which make calls to __ucmpdi2, a function defined in libgcc. I figured > > out that it was

Re: __ucmpdi2

2000-09-19 Thread Andreas Schwab
Matti Aarnio <[EMAIL PROTECTED]> writes: |> On Tue, Sep 19, 2000 at 02:58:01AM -0700, Jeremy Higdon wrote: |> > Hello, |> > |> > I'm using a 64 bit variable in a switch statement. Gcc is generating code |> > which make calls to __ucmpdi2, a function defined in libgcc. I figured |> > out that i

Re: __ucmpdi2

2000-09-19 Thread Matti Aarnio
On Tue, Sep 19, 2000 at 02:58:01AM -0700, Jeremy Higdon wrote: > Hello, > > I'm using a 64 bit variable in a switch statement. Gcc is generating code > which make calls to __ucmpdi2, a function defined in libgcc. I figured > out that it was the switch statement from examining the generated code