An interesting approach to memset()

By: Gabriele Svelto (gabriele.svelto.delete@this.gmail.com), February 5, 2021 5:30 am
Room: Moderated Discussions
See this interesting post on MSRC's blog:

Building Faster AMD64 Memset Routines

In a nutshell the author replaced a significant number of unpredictable branches with overlapping stores, calculating their addresses in branch-less code. The results effectively take advantage of the very good store buffer implementations and efficient handling of unaligned accesses on modern x86 processors.

I found the article particularly interesting because in my testing of other highly data-dependent leaf functions - such as memcpy() and string manipulation functions - branch mispredictions always stood out as the biggest contributor in the time spent there. I definitely prefer this approach to the jump-happy versions that are more common (like in glibc for example).
 Next Post in Thread >
TopicPosted ByDate
An interesting approach to memset()Gabriele Svelto2021/02/05 05:30 AM
  An interesting approach to memset()Adrian2021/02/05 06:21 AM
  An interesting approach to memset()rwessel2021/02/05 06:56 AM
  An interesting approach to memset()Foo_2021/02/05 09:40 AM
    An interesting approach to memset()Wilco2021/02/05 02:15 PM
      An interesting approach to memset()Anon2021/02/05 02:32 PM
        An interesting approach to memset()Wilco2021/02/06 10:15 AM
      An interesting approach to memset()Linus Torvalds2021/02/05 02:39 PM
        An interesting approach to memset()Jörn Engel2021/02/07 02:48 PM
          An interesting approach to memset()Linus Torvalds2021/02/07 03:14 PM
            An interesting approach to memset()Jörn Engel2021/02/07 04:00 PM
              An interesting approach to memset()Jörn Engel2021/02/08 11:32 AM
                An interesting approach to memset()Andrey2021/02/08 01:46 PM
                  An interesting approach to memset()Andrey2021/02/08 02:22 PM
                    An interesting approach to memset()Jörn Engel2021/02/08 02:39 PM
            An interesting approach to memset()Carson2021/02/07 07:02 PM
              An interesting approach to memset()Mark Roulo2021/02/07 07:31 PM
                An interesting approach to memset()Dummond D. Slow2021/02/07 08:02 PM
                  An interesting approach to memset()anon22021/02/07 10:22 PM
                    An interesting approach to memset()Anon2021/02/08 01:16 AM
                      An interesting approach to memset()anon22021/02/08 04:20 AM
                        An interesting approach to memset()Dummond D. Slow2021/02/08 06:50 PM
                          An interesting approach to memset()anon22021/02/09 06:04 PM
                    An interesting approach to memset()gallier22021/02/08 01:19 AM
                      An interesting approach to memset()anon22021/02/08 04:23 AM
                      An interesting approach to memset()Michael S2021/02/08 05:17 AM
                        An interesting approach to memset()Anon2021/02/08 06:43 AM
                        An interesting approach to memset()Adrian2021/02/08 10:34 AM
            An interesting approach to memset()Jouni Osmala2021/02/08 03:37 AM
              An interesting approach to memset()Anon2021/02/08 06:49 AM
                An interesting approach to memset()anonymou52021/02/08 11:02 AM
                  An interesting approach to memset()Anon2021/02/08 11:18 AM
                    An interesting approach to memset()anonymou52021/02/08 12:28 PM
                      An interesting approach to memset()Linus Torvalds2021/02/08 01:01 PM
                        An interesting approach to memset()anonymou52021/02/08 07:17 PM
                          An interesting approach to memset()Chester2021/02/09 09:15 AM
            An interesting approach to memset()Michael S2021/02/08 05:29 AM
              An interesting approach to memset()j2021/02/08 09:01 AM
                An interesting approach to memset()Linus Torvalds2021/02/08 12:18 PM
            An interesting approach to memset()wumpus2021/02/08 11:25 AM
            quibbleCarlie Coats2021/02/09 09:23 AM
              quibbleMichael S2021/02/09 09:47 AM
              quibblerwessel2021/02/09 07:56 PM
              quibbleMark Roulo2021/02/11 10:40 AM
                quibblerwessel2021/02/11 12:17 PM
                  quibbledmcq2021/02/12 03:37 AM
          AVX512 vs. SVE?RA2021/02/08 02:40 AM
            AVX512 vs. SVE?dmcq2021/02/08 03:34 AM
              AVX512 vs. SVE?Doug S2021/02/08 10:36 AM
                AVX512 vs. SVE?Michael S2021/02/08 12:03 PM
                AVX512 vs. SVE?dmcq2021/02/08 12:05 PM
                AVX512 vs. SVE?Jukka Larja2021/02/09 06:05 AM
                  AVX512 vs. SVE?Michael S2021/02/09 09:52 AM
                  AVX512 vs. SVE?-.-2021/02/09 06:58 PM
              AVX512 vs. SVE?none2021/02/09 04:20 AM
                AVX512 vs. SVE?Jörn Engel2021/02/09 10:18 AM
                  AVX512 vs. SVE?Wilco2021/02/09 02:56 PM
                    AVX512 vs. SVE?Jörn Engel2021/02/09 04:24 PM
                    AVX512 vs. SVE?-.-2021/02/09 06:37 PM
            AVX512 vs. SVE?Jörn Engel2021/02/08 11:06 AM
              AVX512 vs. SVE?anon2021/02/09 12:35 PM
          An interesting approach to memset()Romain Dolbeau2021/02/09 12:43 AM
            An interesting approach to memset()Jörn Engel2021/02/09 10:10 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell avocado?