Messages in this thread | | | Date | Tue, 19 Sep 2000 13:08:34 +0300 | From | Matti Aarnio <> | Subject | Re: __ucmpdi2 |
| |
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. > > The question is whether I should change C code to avoid constructions > which make calls to this routine (a little hard to determine a priori) > or if there is an appropriate way to add this to the kernel.
Yes do change it.
Is the value-space for the case's a LONG LONG, or mere set of INTs or LONGs ?
Can you simply (and reliably) cast the variable into e.g. 'long' ? Or should you use if / else if / .. chains ?
> Best I can tell, __ucmpdi2 takes two 64 bit unsigned args, returning > 0 if the 1st arg is less than the 2nd, 2 if greater, 1 if equal. For > now, I have defined the function in my driver with those semantics. > For obvious reasons, I don't consider this a viable long term option. > > thanks > jeremy
/Matti Aarnio - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |