Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #81991
| Newsgroups | comp.lang.c++ |
|---|---|
| From | Branimir Maksimovic <branimir.maksimovic@icloud.com> |
| Subject | Re: faster "CRC"- / "FNV"-hashing |
| References | (6 earlier) <sk0u2a$ajc$1@dont-email.me> <wdT8J.185287$o45.132180@fx46.iad> <sk0vgf$6or$1@dont-email.me> <isin78Fpis6U1@mid.individual.net> <sk1abt$tn7$1@dont-email.me> |
| Message-ID | <dwW8J.64464$md6.15724@fx36.iad> (permalink) |
| Organization | usenet-news.net |
| Date | 2021-10-11 12:56 +0000 |
On 2021-10-11, David Brown <david.brown@hesbynett.no> wrote: > On 11/10/2021 13:58, Bo Persson wrote: >> On 2021-10-11 at 11:18, Bonita Montero wrote: >>> Am 11.10.2021 um 11:11 schrieb Branimir Maksimovic: >>> >>>> ASM code is most efficient always and works as tested without >>>> surprises :P >>> >>> ASM code can be faster in rare cases when you know everyting about >>> your OoO-CPU, but in most cases the compiler generates better code. >>> I've seen code from clang where you might think: there would be no >>> ASM-programmer that knows all of these optimization-tricks. >> >> In this case the asm code is supplied by Intel. >> >> I bet they qualify for "you know everything about your OoO-CPU". :-) >> > > Well, kind of. Intel as a whole probably knows most of what there is to > know about Intel processors. But Intel does not write code - people > working at (or for) Intel write code, and there is absolutely no > guarantee that the person or people who wrote the code know all about > all of Intel's processors - never mind non-Intel x86 processors, or > non-x86 processors, or any other device. At best, you can probably be > quite confident that the code is close to optimal if you run it on the > same processor the assembly author used. > > How well it will run on the dozen other current Intel processor > variations is another matter (by "dozen", I am ignoring devices that > differ only in clock speed or core count, and ignoring older devices). > How well it will run on AMD processors is also another matter. > > You write these routines in C (or C++), and you tune the optimisation. > You compile with "-fmarch=native", or whatever flag your compiler has to > get the fastest code for your particular processor. You use compiler > features for multi-versioning for target-specific optimisations, so that > the compiler generates versions for different SIMD and other instruction > set extensions, and picks the best version for the real cpu when the > code starts up. You use inline assembly or intrinsics for specific > target versions if you are /sure/ your assembly works faster, and have > measured it. > > General use of assembly language is something that comes /way/ down on > the list when you are trying to get fast implementation of code. Compiler at best can produce generic optimistic code that does not stand a chance against dedicated human :P ONly reason we do not program in assembler is because lerning curve is steep :P -- 7-77-777 Evil Sinner! with software, you repeat same experiment, expecting different results...
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-10 18:51 +0200
Re: faster "CRC"- / "FNV"-hashing "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-10-10 12:36 -0700
Re: faster "CRC"- / "FNV"-hashing scott@slp53.sl.home (Scott Lurndal) - 2021-10-10 22:51 +0000
Re: faster "CRC"- / "FNV"-hashing "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-10-12 13:47 -0700
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 08:09 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 05:23 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 08:15 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 06:29 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 08:34 +0200
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 08:27 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 06:32 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 08:33 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 07:46 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 10:53 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 09:11 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 11:18 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 10:42 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 13:03 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 11:12 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 13:44 +0200
Re: faster "CRC"- / "FNV"-hashing Bo Persson <bo@bo-persson.se> - 2021-10-11 13:58 +0200
Re: faster "CRC"- / "FNV"-hashing David Brown <david.brown@hesbynett.no> - 2021-10-11 14:23 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 12:56 +0000
Re: faster "CRC"- / "FNV"-hashing Bonita Montero <Bonita.Montero@gmail.com> - 2021-10-11 15:55 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 16:55 +0000
Re: faster "CRC"- / "FNV"-hashing RadicalRabbit@theburrow.co.uk - 2021-10-12 09:06 +0000
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-12 11:01 +0000
Re: faster "CRC"- / "FNV"-hashing RadicalRabbit@theburrow.co.uk - 2021-10-12 14:49 +0000
Re: faster "CRC"- / "FNV"-hashing David Brown <david.brown@hesbynett.no> - 2021-10-11 17:19 +0200
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 16:57 +0000
Re: faster "CRC"- / "FNV"-hashing Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2021-10-11 05:41 +0000
csiph-web