News for hackers. Stuff that matters.
Re:The Boyer-Moore Fast String Searching Algorithm by tankenmate on Friday April 23, 2021 @04:43AM (#26912503)
If you know the maximum width of the sub string you are searching for you can easily calculate the maximal forward jump, and hence you'll know when to issue a pre-fetch.
Re:The Boyer-Moore Fast String Searching Algorithm by tankenmate on Friday April 23, 2021 @04:54AM (#26912568)
Having had a quick look at the AMD 17h processor family optimization guide, it would seem that the PREFETCHNTA opcode is the one you are looking for; it hints to the processor to pull the memory pointer close to the processor while avoiding polluting the cache.

For GCC it would seem that using this built in pseudo function call does the trick;

__builtin_prefetch((void *)p,0,0);

Re:The Boyer-Moore Fast String Searching Algorithm by lofi_lory on Friday April 23, 2021 @11:42AM (#26915882)
Yes ofc. I was making a theoretical argument. Assumptions about the data or hardware matter in practice, but they are not relevant for the theoretical exploration.