mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Added gcc lto (Link Time Optimization) option
Just by adding the -flto option to CXXFLAGS link command we can gain a few percent in speed. On a Core i5-2500 (3300 Mhz, Sandy Bridge): 64 bit download version: Without -flto: 1597151 n/s With -flto : 1659664 n/s No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
3141490374
commit
09b5949cd2
1 changed files with 10 additions and 0 deletions
10
src/Makefile
10
src/Makefile
|
@ -52,6 +52,7 @@ OBJS = benchmark.o bitbase.o bitboard.o book.o endgame.o evaluate.o main.o \
|
|||
# bsfq = no/yes --- -DUSE_BSFQ --- Use bsfq x86_64 asm-instruction
|
||||
# --- (Works only with GCC and ICC 64-bit)
|
||||
# popcnt = no/yes --- -DUSE_POPCNT --- Use popcnt x86_64 asm-instruction
|
||||
# lto = no/yes --- -flto --- gcc Link Time Optimization
|
||||
#
|
||||
# Note that Makefile is space sensitive, so when adding new architectures
|
||||
# or modifying existing flags, you have to make sure there are no extra spaces
|
||||
|
@ -123,6 +124,7 @@ ifeq ($(ARCH),x86-64-modern)
|
|||
prefetch = yes
|
||||
bsfq = yes
|
||||
popcnt = yes
|
||||
lto = yes
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86-32)
|
||||
|
@ -311,6 +313,14 @@ ifeq ($(popcnt),yes)
|
|||
CXXFLAGS += -DUSE_POPCNT
|
||||
endif
|
||||
|
||||
### 3.11 lto.
|
||||
### Note that this is a mix of compile and link time options
|
||||
### because the lto link phase needs access to the optimization flags
|
||||
ifeq ($(lto),yes)
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += $(CXXFLAGS) -static
|
||||
endif
|
||||
|
||||
### ==========================================================================
|
||||
### Section 4. Public targets
|
||||
### ==========================================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue