]> git.sesse.net Git - stockfish/commitdiff
Add sse4 if bmi2 is enabled
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 12 Sep 2019 19:25:58 +0000 (21:25 +0200)
committerStéphane Nicolet <cassio@free.fr>
Sat, 14 Sep 2019 05:11:23 +0000 (07:11 +0200)
The only change done to the Makefile to get a somewhat faster binary as
discussed in #2291 is to add -msse4 to the compile options of the bmi2 build.
Since all processors supporting bmi2 also support sse4 this can be done easily.
It is a useful step to avoid sending around custom and poorly tested builds.

The speedup isn't enough to pass [0,4] but it is roughly 1.15Elo and a LOS of 90%:
LLR: -2.95 (-2.94,2.94) [0.00,4.00]
Total: 93009 W: 20519 L: 20316 D: 52174

Also rewrite the documentation for the user when using `make --help`, so that
the order of architectures for x86-64 has the more performant build one on top.

Closes https://github.com/official-stockfish/Stockfish/pull/2300

No functional change

src/Makefile

index 285d314ec302d34e9d200bce53fa5c42ad243fdf..6deb0e27a6a9faed0acb938267a1dfa11ef260dd 100644 (file)
@@ -328,7 +328,7 @@ endif
 ifeq ($(pext),yes)
        CXXFLAGS += -DUSE_PEXT
        ifeq ($(comp),$(filter $(comp),gcc clang mingw))
 ifeq ($(pext),yes)
        CXXFLAGS += -DUSE_PEXT
        ifeq ($(comp),$(filter $(comp),gcc clang mingw))
-               CXXFLAGS += -mbmi2
+               CXXFLAGS += -msse4 -mbmi2
        endif
 endif
 
        endif
 endif
 
@@ -379,9 +379,9 @@ help:
        @echo ""
        @echo "Supported archs:"
        @echo ""
        @echo ""
        @echo "Supported archs:"
        @echo ""
-       @echo "x86-64                  > x86 64-bit"
-       @echo "x86-64-modern           > x86 64-bit with popcnt support"
-       @echo "x86-64-bmi2             > x86 64-bit with pext support"
+       @echo "x86-64-bmi2             > x86 64-bit with pext support (also enables SSE4)"
+       @echo "x86-64-modern           > x86 64-bit with popcnt support (also enables SSE3)"
+       @echo "x86-64                  > x86 64-bit generic"
        @echo "x86-32                  > x86 32-bit with SSE support"
        @echo "x86-32-old              > x86 32-bit fall back for old hardware"
        @echo "ppc-64                  > PPC 64-bit"
        @echo "x86-32                  > x86 32-bit with SSE support"
        @echo "x86-32-old              > x86 32-bit fall back for old hardware"
        @echo "ppc-64                  > PPC 64-bit"