1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

Makefile rework/cleanup

Makefile targets x86-64-sse42, x86-sse3 are removed; x86-64-sse41
is renamed to x86-64-sse41-popcnt (it did enable popcnt).

Makefile variables sse3, sse42, their associated compilation flags
and code in misc.cpp are removed.

closes https://github.com/official-stockfish/Stockfish/pull/2922

No functional change
This commit is contained in:
sf-x 2020-08-09 18:01:18 +03:00 committed by Joost VandeVondele
parent ad2ad4c657
commit cb0504028e
2 changed files with 3 additions and 61 deletions

View file

@ -68,10 +68,8 @@ endif
# prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction # prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction
# popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction # popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction
# sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions # sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions
# sse3 = yes/no --- -msse3 --- Use Intel Streaming SIMD Extensions 3
# ssse3 = yes/no --- -mssse3 --- Use Intel Supplemental Streaming SIMD Extensions 3 # ssse3 = yes/no --- -mssse3 --- Use Intel Supplemental Streaming SIMD Extensions 3
# sse41 = yes/no --- -msse4.1 --- Use Intel Streaming SIMD Extensions 4.1 # sse41 = yes/no --- -msse4.1 --- Use Intel Streaming SIMD Extensions 4.1
# sse42 = yes/no --- -msse4.2 --- Use Intel Streaming SIMD Extensions 4.2
# avx2 = yes/no --- -mavx2 --- Use Intel Advanced Vector Extensions 2 # avx2 = yes/no --- -mavx2 --- Use Intel Advanced Vector Extensions 2
# pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction # pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction
# avx512 = yes/no --- -mavx512bw --- Use Intel Advanced Vector Extensions 512 # avx512 = yes/no --- -mavx512bw --- Use Intel Advanced Vector Extensions 512
@ -89,10 +87,8 @@ bits = 64
prefetch = no prefetch = no
popcnt = no popcnt = no
sse = no sse = no
sse3 = no
ssse3 = no ssse3 = no
sse41 = no sse41 = no
sse42 = no
avx2 = no avx2 = no
pext = no pext = no
avx512 = no avx512 = no
@ -127,18 +123,10 @@ ifeq ($(ARCH),x86-64)
sse = yes sse = yes
endif endif
ifeq ($(ARCH),x86-64-sse3)
arch = x86_64
prefetch = yes
sse = yes
sse3 = yes
endif
ifeq ($(ARCH),x86-64-sse3-popcnt) ifeq ($(ARCH),x86-64-sse3-popcnt)
arch = x86_64 arch = x86_64
prefetch = yes prefetch = yes
sse = yes sse = yes
sse3 = yes
popcnt = yes popcnt = yes
endif endif
@ -146,39 +134,25 @@ ifeq ($(ARCH),x86-64-ssse3)
arch = x86_64 arch = x86_64
prefetch = yes prefetch = yes
sse = yes sse = yes
sse3 = yes
ssse3 = yes ssse3 = yes
endif endif
ifeq ($(ARCH),x86-64-sse41)
arch = x86_64
prefetch = yes
popcnt = yes
sse = yes
sse3 = yes
ssse3 = yes
sse41 = yes
endif
ifeq ($(ARCH),x86-64-modern) ifeq ($(ARCH),x86-64-modern)
arch = x86_64 arch = x86_64
prefetch = yes prefetch = yes
popcnt = yes popcnt = yes
sse = yes sse = yes
sse3 = yes
ssse3 = yes ssse3 = yes
sse41 = yes sse41 = yes
endif endif
ifeq ($(ARCH),x86-64-sse42) ifeq ($(ARCH),x86-64-sse41-popcnt)
arch = x86_64 arch = x86_64
prefetch = yes prefetch = yes
popcnt = yes popcnt = yes
sse = yes sse = yes
sse3 = yes
ssse3 = yes ssse3 = yes
sse41 = yes sse41 = yes
sse42 = yes
endif endif
ifeq ($(ARCH),x86-64-avx2) ifeq ($(ARCH),x86-64-avx2)
@ -186,10 +160,8 @@ ifeq ($(ARCH),x86-64-avx2)
prefetch = yes prefetch = yes
popcnt = yes popcnt = yes
sse = yes sse = yes
sse3 = yes
ssse3 = yes ssse3 = yes
sse41 = yes sse41 = yes
sse42 = yes
avx2 = yes avx2 = yes
endif endif
@ -198,10 +170,8 @@ ifeq ($(ARCH),x86-64-bmi2)
prefetch = yes prefetch = yes
popcnt = yes popcnt = yes
sse = yes sse = yes
sse3 = yes
ssse3 = yes ssse3 = yes
sse41 = yes sse41 = yes
sse42 = yes
avx2 = yes avx2 = yes
pext = yes pext = yes
endif endif
@ -211,10 +181,8 @@ ifeq ($(ARCH),x86-64-avx512)
prefetch = yes prefetch = yes
popcnt = yes popcnt = yes
sse = yes sse = yes
sse3 = yes
ssse3 = yes ssse3 = yes
sse41 = yes sse41 = yes
sse42 = yes
avx2 = yes avx2 = yes
pext = yes pext = yes
avx512 = yes avx512 = yes
@ -450,13 +418,6 @@ ifeq ($(avx512),yes)
endif endif
endif endif
ifeq ($(sse42),yes)
CXXFLAGS += -DUSE_SSE42
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
CXXFLAGS += -msse4.2
endif
endif
ifeq ($(sse41),yes) ifeq ($(sse41),yes)
CXXFLAGS += -DUSE_SSE41 CXXFLAGS += -DUSE_SSE41
ifeq ($(comp),$(filter $(comp),gcc clang mingw)) ifeq ($(comp),$(filter $(comp),gcc clang mingw))
@ -471,13 +432,6 @@ ifeq ($(ssse3),yes)
endif endif
endif endif
ifeq ($(sse3),yes)
CXXFLAGS += -DUSE_SSE3
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
CXXFLAGS += -msse3
endif
endif
ifeq ($(neon),yes) ifeq ($(neon),yes)
CXXFLAGS += -DUSE_NEON CXXFLAGS += -DUSE_NEON
endif endif
@ -557,12 +511,10 @@ help:
@echo "x86-64-avx512 > x86 64-bit with avx512 support" @echo "x86-64-avx512 > x86 64-bit with avx512 support"
@echo "x86-64-bmi2 > x86 64-bit with bmi2 support" @echo "x86-64-bmi2 > x86 64-bit with bmi2 support"
@echo "x86-64-avx2 > x86 64-bit with avx2 support" @echo "x86-64-avx2 > x86 64-bit with avx2 support"
@echo "x86-64-sse42 > x86 64-bit with sse42 support" @echo "x86-64-sse41-popcnt > x86 64-bit with sse41 and popcnt support"
@echo "x86-64-modern > x86 64-bit with sse41 support (x86-64-sse41)" @echo "x86-64-modern > the same as previous (x86-64-sse41-popcnt)"
@echo "x86-64-sse41 > x86 64-bit with sse41 support"
@echo "x86-64-ssse3 > x86 64-bit with ssse3 support" @echo "x86-64-ssse3 > x86 64-bit with ssse3 support"
@echo "x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support" @echo "x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support"
@echo "x86-64-sse3 > x86 64-bit with sse3 support"
@echo "x86-64 > x86 64-bit generic" @echo "x86-64 > x86 64-bit generic"
@echo "x86-32 > x86 32-bit (also enables SSE)" @echo "x86-32 > x86 32-bit (also enables SSE)"
@echo "x86-32-old > x86 32-bit fall back for old hardware" @echo "x86-32-old > x86 32-bit fall back for old hardware"
@ -669,10 +621,8 @@ config-sanity:
@echo "prefetch: '$(prefetch)'" @echo "prefetch: '$(prefetch)'"
@echo "popcnt: '$(popcnt)'" @echo "popcnt: '$(popcnt)'"
@echo "sse: '$(sse)'" @echo "sse: '$(sse)'"
@echo "sse3: '$(sse3)'"
@echo "ssse3: '$(ssse3)'" @echo "ssse3: '$(ssse3)'"
@echo "sse41: '$(sse41)'" @echo "sse41: '$(sse41)'"
@echo "sse42: '$(sse42)'"
@echo "avx2: '$(avx2)'" @echo "avx2: '$(avx2)'"
@echo "pext: '$(pext)'" @echo "pext: '$(pext)'"
@echo "avx512: '$(avx512)'" @echo "avx512: '$(avx512)'"
@ -695,10 +645,8 @@ config-sanity:
@test "$(prefetch)" = "yes" || test "$(prefetch)" = "no" @test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
@test "$(popcnt)" = "yes" || test "$(popcnt)" = "no" @test "$(popcnt)" = "yes" || test "$(popcnt)" = "no"
@test "$(sse)" = "yes" || test "$(sse)" = "no" @test "$(sse)" = "yes" || test "$(sse)" = "no"
@test "$(sse3)" = "yes" || test "$(sse3)" = "no"
@test "$(ssse3)" = "yes" || test "$(ssse3)" = "no" @test "$(ssse3)" = "yes" || test "$(ssse3)" = "no"
@test "$(sse41)" = "yes" || test "$(sse41)" = "no" @test "$(sse41)" = "yes" || test "$(sse41)" = "no"
@test "$(sse42)" = "yes" || test "$(sse42)" = "no"
@test "$(avx2)" = "yes" || test "$(avx2)" = "no" @test "$(avx2)" = "yes" || test "$(avx2)" = "no"
@test "$(pext)" = "yes" || test "$(pext)" = "no" @test "$(pext)" = "yes" || test "$(pext)" = "no"
@test "$(avx512)" = "yes" || test "$(avx512)" = "no" @test "$(avx512)" = "yes" || test "$(avx512)" = "no"

View file

@ -220,17 +220,11 @@ const std::string compiler_info() {
#if defined(USE_AVX2) #if defined(USE_AVX2)
compiler += " AVX2"; compiler += " AVX2";
#endif #endif
#if defined(USE_SSE42)
compiler += " SSE42";
#endif
#if defined(USE_SSE41) #if defined(USE_SSE41)
compiler += " SSE41"; compiler += " SSE41";
#endif #endif
#if defined(USE_SSSE3) #if defined(USE_SSSE3)
compiler += " SSSE3"; compiler += " SSSE3";
#endif
#if defined(USE_SSE3)
compiler += " SSE3";
#endif #endif
compiler += (HasPext ? " BMI2" : ""); compiler += (HasPext ? " BMI2" : "");
compiler += (HasPopCnt ? " POPCNT" : ""); compiler += (HasPopCnt ? " POPCNT" : "");