From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 675CCA09DE; Fri, 13 Nov 2020 12:12:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D092AC90A; Fri, 13 Nov 2020 12:10:21 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 785A1C8D6 for ; Fri, 13 Nov 2020 12:10:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id B4420B92E2; Fri, 13 Nov 2020 12:10:06 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qv3F4XWMRJ8N; Fri, 13 Nov 2020 12:10:05 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 2166BB92EC; Fri, 13 Nov 2020 12:09:59 +0100 (CET) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com, ajit.khaparde@broadcom.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Date: Fri, 13 Nov 2020 12:09:43 +0100 Message-Id: <1605265789-12932-10-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605265789-12932-1-git-send-email-juraj.linkes@pantheon.tech> References: <1605100718-7991-1-git-send-email-juraj.linkes@pantheon.tech> <1605265789-12932-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v10 09/15] build: use native machine args in Arm native build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Letting the compiler decide is going to yield the best results for native builds, so use native machine args usable for both GCC and Clang. Signed-off-by: Juraj Linkeš --- config/arm/meson.build | 54 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index fec06e70c..bee57f089 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -3,8 +3,6 @@ # Copyright(c) 2017 Cavium, Inc # Copyright(c) 2020 PANTHEON.tech s.r.o. -arm_force_native_march = false - # common flags to all aarch64 builds, with lowest priority flags_common = [ # Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest) @@ -27,6 +25,7 @@ flags_common = [ ['RTE_ARCH_ARM64', true], ['RTE_CACHE_LINE_SIZE', 128] ] +native_machine_args = ['-mcpu=native'] ## Part numbers are specific to Arm implementers # implementer specific aarch64 flags have middle priority @@ -48,7 +47,6 @@ implementer_generic = { } part_number_config_arm = { - 'native': {'machine_args': ['-march=native']}, '0xd03': {'machine_args': ['-mcpu=cortex-a53']}, '0xd04': {'machine_args': ['-mcpu=cortex-a35']}, '0xd07': {'machine_args': ['-mcpu=cortex-a57']}, @@ -96,7 +94,6 @@ implementer_cavium = { ['RTE_MAX_NUMA_NODES', 2] ], 'part_number_config': { - 'native': {'machine_args': ['-march=native']}, '0xa1': { 'machine_args': ['-mcpu=thunderxt88'], 'flags': flags_part_number_thunderx @@ -146,8 +143,7 @@ implementer_ampere = { ], 'part_number_config': { '0x0': {'machine_args': ['-march=armv8-a+crc+crypto', - '-mtune=emag']}, - 'native': {'machine_args': ['-march=native']} + '-mtune=emag']} } } @@ -196,26 +192,27 @@ if dpdk_conf.get('RTE_ARCH_32') machine_args += '-mfpu=neon' else # aarch64 build - if machine == 'generic' and not meson.is_cross_build() - # generic build - implementer_id = 'generic' - part_number = 'generic' - elif not meson.is_cross_build() - # native build - # The script returns ['Implementer', 'Variant', 'Architecture', - # 'Primary Part number', 'Revision'] - detect_vendor = find_program(join_paths( - meson.current_source_dir(), 'armv8_machine.py')) - cmd = run_command(detect_vendor.path()) - if cmd.returncode() == 0 - cmd_output = cmd.stdout().to_lower().strip().split(' ') - implementer_id = cmd_output[0] - part_number = cmd_output[3] + use_native_machine_args = false + if not meson.is_cross_build() + if machine == 'generic' + # generic build + implementer_id = 'generic' + part_number = 'generic' else - error('Error when getting Arm Implementer ID and part number.') - endif - if arm_force_native_march == true - part_number = 'native' + # native build + # The script returns ['Implementer', 'Variant', 'Architecture', + # 'Primary Part number', 'Revision'] + detect_vendor = find_program(join_paths( + meson.current_source_dir(), 'armv8_machine.py')) + cmd = run_command(detect_vendor.path()) + if cmd.returncode() == 0 + cmd_output = cmd.stdout().to_lower().strip().split(' ') + implementer_id = cmd_output[0] + part_number = cmd_output[3] + else + error('Error when getting Arm Implementer ID and part number.') + endif + use_native_machine_args = true endif else # cross build @@ -251,7 +248,12 @@ else # apply supported machine args machine_args = [] # Clear previous machine args - foreach flag: part_number_config['machine_args'] + if use_native_machine_args + candidate_machine_args = native_machine_args + else + candidate_machine_args = part_number_config['machine_args'] + endif + foreach flag: candidate_machine_args if cc.has_argument(flag) machine_args += flag endif -- 2.20.1