This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2.0] Use saturated arithmetic for overflow detection.


Thanks for looking into this.

I agree with earlier comments that we care about overall
performance not just the individual ops, that optimizing
for code size is probably best unless we get significant numbers
suggesting otherwise, and that it may be time to ask the GCC folks
for help with fast saturated arithmetic ops.  Some other suggestions:

Stick with inline functions not macros, and use lower-case names since they're
functions.

If you like tuning this stuff you might want to look at
<http://locklessinc.com/articles/sat_arithmetic/>, which
shows how to do saturated arithmetic without jumps, both portably
and on x86-64; I don't know whether this will save code space, though.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]