From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 53423A0C4A; Fri, 16 Jul 2021 05:42:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC7E44014D; Fri, 16 Jul 2021 05:42:28 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id ED16640143 for ; Fri, 16 Jul 2021 05:42:26 +0200 (CEST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GQxk43KTxzXtH5; Fri, 16 Jul 2021 11:36:44 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Jul 2021 11:42:21 +0800 Received: from [10.40.190.165] (10.40.190.165) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Jul 2021 11:42:21 +0800 To: Ruifeng Wang , =?UTF-8?Q?Juraj_Linke=c5=a1?= , "thomas@monjalon.net" , "david.marchand@redhat.com" , "bruce.richardson@intel.com" , "Honnappa Nagarahalli" , "ferruh.yigit@intel.com" , "jerinjacobk@gmail.com" , "jerinj@marvell.com" , Pavan Nikhilesh CC: "dev@dpdk.org" , nd References: <1625559712-23403-1-git-send-email-juraj.linkes@pantheon.tech> <1626094936-6054-1-git-send-email-juraj.linkes@pantheon.tech> From: fengchengwen Message-ID: <26588027-5544-421f-204c-9260fa828ea0@huawei.com> Date: Fri, 16 Jul 2021 11:42:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.40.190.165] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v3] config/arm: split march cfg into arch and features X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" [snip] >> + >> + # probe supported marchs and their features >> + candidate_march = '' >> + if part_number_config.has_key('march') >> + supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-a', >> + 'armv8.2-a', 'armv8.1-a', 'armv8-a'] >> + check_compiler_support = false >> + foreach supported_march: supported_marchs >> + if supported_march == part_number_config['march'] >> + # start checking from this version downwards >> + check_compiler_support = true >> + endif >> + if (check_compiler_support and >> + cc.has_argument('-march=' + supported_march)) >> + candidate_march = supported_march >> + # highest supported march version found >> + break >> + endif I think breaking it down into two steps is more intuitive. step1: find the march version which target config. If not find then error exit. step2: start checking from step1's version. >> + endforeach >> + if candidate_march == '' >> + error('No suitable armv8 march version found.') >> + else There no need use else, because meson will halt when execute error. >> + if candidate_march != part_number_config['march'] >> + warning('Configuration march version is ' + >> + '@0@, but the compiler supports only @1@.' >> + .format(part_number_config['march'], candidate_march)) >> + endif >> + candidate_march = '-march=' + candidate_march >> endif >> - endforeach >> + if part_number_config.has_key('march_features') >> + feature_unsupported = false >> + foreach feature: part_number_config['march_features'] >> + if cc.has_argument('+'.join([candidate_march, feature])) >> + candidate_march = '+'.join([candidate_march, feature]) >> + else >> + feature_unsupported = true >> + endif >> + endforeach >> + if feature_unsupported >> + warning('Configuration march features are ' + >> + '@0@, but the compiler supports only @1@.' >> + .format(part_number_config['march_features'], >> + candidate_march)) the march_feature is some like 'crc sve', but candidate_march is '-march=armv8.2a+crc'. These two displays may be a little weird because later one has -march=armv8.2 prefix. I think it's better move warning to place which feature_unsupported was set true. >> + endif >> + endif >> + machine_args += candidate_march >> + endif >> + >> + # apply supported compiler options >> + if part_number_config.has_key('compiler_options') >> + foreach flag: part_number_config['compiler_options'] >> + if cc.has_argument(flag) Is it possible that -mcpu= conflicts with -march ? >> + machine_args += flag >> + else >> + warning('Configuration compiler option ' + >> + '@0@ isn\'t supported.'.format(flag)) >> + endif >> + endforeach >> + endif >> >> # apply flags >> foreach flag: dpdk_flags >> -- >> 2.20.1 >