From: Intel Date: Wed, 19 Dec 2012 23:00:00 +0000 (+0100) Subject: mk: update for SSE4 and ICC X-Git-Tag: spdx-start~11415 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f4133fefcdd869187cf62cde4c9a887a7bd2ff4b;p=dpdk.git mk: update for SSE4 and ICC Signed-off-by: Intel --- diff --git a/mk/toolchain/gcc/rte.toolchain-compat.mk b/mk/toolchain/gcc/rte.toolchain-compat.mk index a4bd13ccf9..88191e5720 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 ff17e46846..865a238a24 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