Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1261001
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [GIT] Networking |
| Date | 2015-11-02 22:40 +0100 |
| Message-ID | <qquZB-250-39@gated-at.bofh.it> (permalink) |
| References | <qosfv-7mx-3@gated-at.bofh.it> <qovwK-Sj-25@gated-at.bofh.it> <qqu3x-1uH-31@gated-at.bofh.it> <qquGe-1YL-11@gated-at.bofh.it> <qquGj-1YL-115@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Nov 2, 2015 at 1:19 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Mon, Nov 2, 2015 at 1:16 PM, Linus Torvalds > <torvalds@linux-foundation.org> wrote: >> On Mon, Nov 2, 2015 at 12:34 PM, Andy Lutomirski <luto@kernel.org> wrote: >>> >>> Getting overflow checking right in more complicated cases is a PITA. >> >> No it is not. Not for unsigned values. > > Just to clarify. The "oevrflow" test for unsigned subtracts of "a-b" > (it's really an underflow, but whatever) really is just > > (b > a) > > Really. That's it. Claiming that that is "complicated" and needs a > helper function is not something sane people do. A fifth-grader that > isn't good at math can understand that. > > In contrast, nobody sane understands "usub_overflow(a, b, &res)". > > So really. Stop making inane arguments. I'll stop making inane arguments if you stop bashing arguments I didn't make. :) I said the helpers were useful for multiplication (by which I meant both signed and unsigned) and, to a lesser extent, for signed addition and subtraction. I don't believe I even tried to justify usub_overflow as anything other than an extremely minor optimization that probably isn't worthwhile. --Andy, who still has inline asm that does 'cmovo' and such in his code for work, sigh. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [GIT] Networking Andy Lutomirski <luto@kernel.org> - 2015-11-02 21:40 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-02 22:20 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-02 22:20 +0100
Re: [GIT] Networking Andy Lutomirski <luto@amacapital.net> - 2015-11-02 22:40 +0100
Re: [GIT] Networking Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-11-02 23:20 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-03 00:30 +0100
Re: [GIT] Networking Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-11-03 02:00 +0100
Re: [GIT] Networking Andy Lutomirski <luto@amacapital.net> - 2015-11-03 03:00 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-03 03:40 +0100
Re: [GIT] Networking Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-11-03 14:00 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-03 21:10 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-03 21:50 +0100
RE: [GIT] Networking David Laight <David.Laight@ACULAB.COM> - 2015-11-06 16:30 +0100
Re: [GIT] Networking Andy Lutomirski <luto@amacapital.net> - 2015-11-07 01:50 +0100
Re: [GIT] Networking Ingo Molnar <mingo@kernel.org> - 2015-11-09 09:20 +0100
Re: [GIT] Networking Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-11-09 11:40 +0100
Re: [GIT] Networking Hannes Frederic Sowa <hannes@stressinduktion.org> - 2015-11-09 11:40 +0100
Re: [GIT] Networking Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-03 03:00 +0100
csiph-web