New upstream version 18.02
[deb_dpdk.git] / mk / toolchain / icc / rte.toolchain-compat.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 #
5 # CPUID-related options
6 #
7 # This was added to support compiler versions which might not support all the
8 # flags we need
9 #
10
11 # find out ICC version
12
13 ICC_MAJOR_VERSION = $(shell icc -dumpversion | cut -f1 -d.)
14
15 ifeq ($(shell test $(ICC_MAJOR_VERSION) -lt 12 && echo 1), 1)
16         MACHINE_CFLAGS = -xSSE4.2
17 $(warning You are not using ICC 12.x or higher. This is neither supported, nor tested.)
18
19 else
20 # proceed to adjust compiler flags
21
22         ICC_MINOR_VERSION = $(shell icc -dumpversion | cut -f2 -d.)
23
24 # replace GCC flags with ICC flags
25         # if icc version >= 12
26         ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 12 && echo 1), 1)
27                 # Atom
28                 MACHINE_CFLAGS := $(patsubst -march=atom,-xSSSE3_ATOM -march=atom,$(MACHINE_CFLAGS))
29                 # nehalem/westmere
30                 MACHINE_CFLAGS := $(patsubst -march=corei7,-xSSE4.2 -march=corei7,$(MACHINE_CFLAGS))
31                 # sandy bridge
32                 MACHINE_CFLAGS := $(patsubst -march=corei7-avx,-xAVX,$(MACHINE_CFLAGS))
33                 # ivy bridge
34                 MACHINE_CFLAGS := $(patsubst -march=core-avx-i,-xCORE-AVX-I,$(MACHINE_CFLAGS))
35                 # hsw
36                 MACHINE_CFLAGS := $(patsubst -march=core-avx2,-xCORE-AVX2,$(MACHINE_CFLAGS))
37                 # remove westmere flags
38                 MACHINE_CFLAGS := $(filter-out -mpclmul -maes,$(MACHINE_CFLAGS))
39         endif
40         # if icc version == 12.0
41         ifeq ($(shell test $(ICC_MAJOR_VERSION) -eq 12 && test $(ICC_MINOR_VERSION) -eq 0 && echo 1), 1)
42                 # Atom
43                 MACHINE_CFLAGS := $(patsubst -xSSSE3_ATOM,-xSSE3_ATOM,$(MACHINE_CFLAGS))
44                 # remove march options
45                 MACHINE_CFLAGS := $(patsubst -march=%,-xSSE3,$(MACHINE_CFLAGS))
46         endif
47
48         # Disable thunderx PMD for icc <= 16.0
49         ifeq ($(shell test $(ICC_MAJOR_VERSION) -le 16 && echo 1), 1)
50                 CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d
51         endif
52
53         # Disable event/opdl  PMD for icc <= 16.0
54         ifeq ($(shell test $(ICC_MAJOR_VERSION) -le 16 && echo 1), 1)
55                 CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV=d
56         endif
57
58 endif