2017-12-19 15:49:04 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2010-2014 Intel Corporation
|
2014-02-17 13:46:06 +01:00
|
|
|
|
|
|
|
# this makefile is called from the generic rte.vars.mk and is
|
|
|
|
# used to set the RTE_CPUFLAG_* environment variables giving details
|
|
|
|
# of what instruction sets the target cpu supports.
|
|
|
|
|
2015-12-07 14:56:43 +02:00
|
|
|
AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(WERROR_FLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null)
|
2014-02-17 13:46:06 +01:00
|
|
|
|
|
|
|
# adding flags to CPUFLAGS
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__SSE__),)
|
|
|
|
CPUFLAGS += SSE
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__SSE2__),)
|
|
|
|
CPUFLAGS += SSE2
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__SSE3__),)
|
|
|
|
CPUFLAGS += SSE3
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__SSSE3__),)
|
|
|
|
CPUFLAGS += SSSE3
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__SSE4_1__),)
|
|
|
|
CPUFLAGS += SSE4_1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__SSE4_2__),)
|
|
|
|
CPUFLAGS += SSE4_2
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__AES__),)
|
|
|
|
CPUFLAGS += AES
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__PCLMUL__),)
|
|
|
|
CPUFLAGS += PCLMULQDQ
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__AVX__),)
|
2017-04-27 19:00:14 -04:00
|
|
|
ifeq ($(CONFIG_RTE_ENABLE_AVX),y)
|
2014-02-17 13:46:06 +01:00
|
|
|
CPUFLAGS += AVX
|
|
|
|
endif
|
2017-04-27 19:00:14 -04:00
|
|
|
endif
|
2014-02-17 13:46:06 +01:00
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
|
|
|
|
CPUFLAGS += RDRAND
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
|
|
|
|
CPUFLAGS += FSGSBASE
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
|
|
|
|
CPUFLAGS += F16C
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
|
2017-04-27 19:00:14 -04:00
|
|
|
ifeq ($(CONFIG_RTE_ENABLE_AVX),y)
|
2014-02-17 13:46:06 +01:00
|
|
|
CPUFLAGS += AVX2
|
|
|
|
endif
|
2017-04-27 19:00:14 -04:00
|
|
|
endif
|
2014-02-17 13:46:06 +01:00
|
|
|
|
2016-01-17 22:05:11 -05:00
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__AVX512F__),)
|
2017-04-27 19:00:14 -04:00
|
|
|
ifeq ($(CONFIG_RTE_ENABLE_AVX512),y)
|
2016-01-17 22:05:11 -05:00
|
|
|
CPUFLAGS += AVX512F
|
|
|
|
endif
|
2017-04-27 19:00:14 -04:00
|
|
|
endif
|
2016-01-17 22:05:11 -05:00
|
|
|
|
2014-11-25 17:17:11 -05:00
|
|
|
# IBM Power CPU flags
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__PPC64__),)
|
|
|
|
CPUFLAGS += PPC64
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__PPC32__),)
|
|
|
|
CPUFLAGS += PPC32
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__vector),)
|
|
|
|
CPUFLAGS += ALTIVEC
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__builtin_vsx_xvnmaddadp),)
|
|
|
|
CPUFLAGS += VSX
|
|
|
|
endif
|
|
|
|
|
2015-11-03 00:47:22 +01:00
|
|
|
# ARM flags
|
2016-03-19 20:58:03 +01:00
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_NEON),)
|
2015-11-03 00:47:22 +01:00
|
|
|
CPUFLAGS += NEON
|
|
|
|
endif
|
|
|
|
|
2015-11-24 00:15:36 +05:30
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_FEATURE_CRC32),)
|
|
|
|
CPUFLAGS += CRC32
|
|
|
|
endif
|
|
|
|
|
2017-07-04 02:24:05 -07:00
|
|
|
ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_FEATURE_CRYPTO),)
|
|
|
|
CPUFLAGS += AES
|
|
|
|
CPUFLAGS += PMULL
|
|
|
|
CPUFLAGS += SHA1
|
|
|
|
CPUFLAGS += SHA2
|
|
|
|
endif
|
2015-11-03 00:47:22 +01:00
|
|
|
|
2014-02-17 13:46:06 +01:00
|
|
|
MACHINE_CFLAGS += $(addprefix -DRTE_MACHINE_CPUFLAG_,$(CPUFLAGS))
|
|
|
|
|
|
|
|
# To strip whitespace
|
|
|
|
comma:= ,
|
|
|
|
empty:=
|
|
|
|
space:= $(empty) $(empty)
|
|
|
|
CPUFLAGSTMP1 := $(addprefix RTE_CPUFLAG_,$(CPUFLAGS))
|
|
|
|
CPUFLAGSTMP2 := $(subst $(space),$(comma),$(CPUFLAGSTMP1))
|
2016-03-21 21:12:55 +01:00
|
|
|
CPUFLAGS_LIST := -DRTE_COMPILE_TIME_CPUFLAGS=$(CPUFLAGSTMP2)
|