summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorIntel <intel.com>2012-12-20 00:00:00 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-07-25 15:01:57 +0200
commitf4133fefcdd869187cf62cde4c9a887a7bd2ff4b (patch)
tree7aef958f814ac2784ac0097cc1d36621b8f3c989 /mk
parent51d02e4f57a866d5930df408ab9fec1e921e7613 (diff)
downloaddpdk-f4133fefcdd869187cf62cde4c9a887a7bd2ff4b.zip
dpdk-f4133fefcdd869187cf62cde4c9a887a7bd2ff4b.tar.gz
dpdk-f4133fefcdd869187cf62cde4c9a887a7bd2ff4b.tar.xz
mk: update for SSE4 and ICC
Signed-off-by: Intel
Diffstat (limited to 'mk')
-rw-r--r--mk/toolchain/gcc/rte.toolchain-compat.mk6
-rw-r--r--mk/toolchain/icc/rte.toolchain-compat.mk10
2 files changed, 12 insertions, 4 deletions
diff --git a/mk/toolchain/gcc/rte.toolchain-compat.mk b/mk/toolchain/gcc/rte.toolchain-compat.mk
index a4bd13c..88191e5 100644
--- a/mk/toolchain/gcc/rte.toolchain-compat.mk
+++ b/mk/toolchain/gcc/rte.toolchain-compat.mk
@@ -71,6 +71,12 @@ else
endif
ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 4 && echo 1), 1)
MACHINE_CFLAGS := $(filter-out -mavx -mpclmul -maes,$(MACHINE_CFLAGS))
+ ifneq ($(findstring SSE4_2, $(CPUFLAGS)),)
+ MACHINE_CFLAGS += -msse4.2
+ endif
+ ifneq ($(findstring SSE4_1, $(CPUFLAGS)),)
+ MACHINE_CFLAGS += -msse4.1
+ endif
endif
ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 3 && echo 1), 1)
MACHINE_CFLAGS := $(filter-out -msse% -mssse%,$(MACHINE_CFLAGS))
diff --git a/mk/toolchain/icc/rte.toolchain-compat.mk b/mk/toolchain/icc/rte.toolchain-compat.mk
index ff17e46..865a238 100644
--- a/mk/toolchain/icc/rte.toolchain-compat.mk
+++ b/mk/toolchain/icc/rte.toolchain-compat.mk
@@ -41,9 +41,9 @@
ICC_MAJOR_VERSION = $(shell icc -dumpversion | cut -f1 -d.)
-ifneq ($(ICC_MAJOR_VERSION),12)
+ifeq ($(shell test $(ICC_MAJOR_VERSION) -lt 12 && echo 1), 1)
MACHINE_CFLAGS = -xSSE3
-$(warning You are not using ICC 12.x. This is neither supported, nor tested.)
+$(warning You are not using ICC 12.x or higher. This is neither supported, nor tested.)
else
# proceed to adjust compiler flags
@@ -51,7 +51,8 @@ else
ICC_MINOR_VERSION = $(shell icc -dumpversion | cut -f2 -d.)
# replace GCC flags with ICC flags
- ifeq ($(shell test $(ICC_MINOR_VERSION) -lt 2 && echo 1), 1)
+ # if icc version >= 12
+ ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 12 && echo 1), 1)
# Atom
MACHINE_CFLAGS := $(patsubst -march=atom,-xSSSE3_ATOM -march=atom,$(MACHINE_CFLAGS))
# nehalem/westmere
@@ -63,7 +64,8 @@ else
# remove westmere flags
MACHINE_CFLAGS := $(filter-out -mpclmul -maes,$(MACHINE_CFLAGS))
endif
- ifeq ($(shell test $(ICC_MINOR_VERSION) -lt 1 && echo 1), 1)
+ # if icc version == 12.0
+ ifeq ($(shell test $(ICC_MAJOR_VERSION) -eq 12 && test $(ICC_MINOR_VERSION) -eq 0 && echo 1), 1)
# Atom
MACHINE_CFLAGS := $(patsubst -xSSSE3_ATOM,-xSSE3_ATOM,$(MACHINE_CFLAGS))
# remove march options