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 30985A0546; Fri, 30 Apr 2021 18:09:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4841640685; Fri, 30 Apr 2021 18:09:35 +0200 (CEST) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 48607410F6 for ; Fri, 30 Apr 2021 18:09:34 +0200 (CEST) Received: by mail-pj1-f43.google.com with SMTP id gc22-20020a17090b3116b02901558435aec1so2009981pjb.4 for ; Fri, 30 Apr 2021 09:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DkodE91mMO5VKxsJHX9ueeYhojc5nUB6LD34wNWcpBc=; b=cUkk1BGWSRI98k2PF/OGWh0woPiyzc/bODuGeliYAleogwWkWCiX6yxLBmYPlon+ln d0te4TLTuJcR/XDGMlNtH3smYqA+Aysj53g59WwUxD6Ig7FyxjQPosr2ymEW77Dh5T49 mTdiTc3NcITQu/iYPdWiBiN79r8Z9mO2aqAk0orOugcQNEWjmJSlAKJ1PFBnhth7meV6 TvZ8Yj/NzmkPqkNwM2Pe6BMZiiME74BXKpuPhi43S9iXXnJEvTDRKI+Px/SBabvARgYO 8uo4Y4OnV0eI1c+CZ7CX1EjUWPmpq96YWAPcWzmgOkWWzTB7onJbX0eBnNjCR74GJUDT shIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DkodE91mMO5VKxsJHX9ueeYhojc5nUB6LD34wNWcpBc=; b=QKj59RDCQIEVpuRqLaxtpLzS2XlhJoZWS+xJup1vTdSr7skBYWtbE/D/wmtgEGBJiR nLJn/wuMv44VgrNSSewuzRN+1vX3pmodXK+vypDc41F3KK1bdxN4YGfrRaCDPC48VLbY 5q/g0SUAu83dpBtKOv3/gU2SbJnoRXWUTrFmngSnngjWk9JhU7YVExaSlBj/WAenkBnY HE1pJYot+kRjBwSKQA5Hk7D/Jiy0HpJGDzo9dMy9saAvNt/OF7rzX2Wub76C57D3yHae LuJH+4dNjl2//vxA6t9ESq2zz6ddHujn2089VxNfWQIZsSO1VCjcTZ36mTkrM1/Fhso+ lUJQ== X-Gm-Message-State: AOAM5329FfuMnntJ/4jMMmi9XW3K9Cdz199/H+PLvhEr27rEVK+KSyEy zLhlQk6FNTRj9BAE91N3CMGfdg== X-Google-Smtp-Source: ABdhPJyywVnzzALtiS6FzzBHXgJxTd57nXxAUH7C44MF0FJk5SVlgbuqRHqsxVGj4X1id7M6Y3E/Ow== X-Received: by 2002:a17:90a:8906:: with SMTP id u6mr6104365pjn.162.1619798973383; Fri, 30 Apr 2021 09:09:33 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id b25sm2672771pfd.7.2021.04.30.09.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 09:09:31 -0700 (PDT) Date: Fri, 30 Apr 2021 09:09:26 -0700 From: Stephen Hemminger To: Jerin Jacob Cc: fengchengwen , "Richardson, Bruce" , Thomas Monjalon , David Marchand , Honnappa Nagarahalli , Stephen Hemminger , "Ananyev, Konstantin" , "dev@dpdk.org" , Jerin Jacob , "Ruifeng Wang (Arm Technology China)" , "humin29@huawei.com" Message-ID: <20210430090926.12178aea@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] How to disable SVE auto vectorization while using GCC 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" On Fri, 30 Apr 2021 20:41:13 +0530 Jerin Jacob wrote: > On Fri, Apr 30, 2021 at 5:27 PM fengchengwen wrote: > > > > Hi, ALL > > We have a question for your help: > > 1. We have two platforms, both of which are ARM64, one of which supports > > both NEON and SVE, the other only support NEON. > > 2. We want to run on both platforms with a single binary file, and use the > > highest vector capability of the corresponding platform whenever possible. > > I see VPP has a similar feature. IMO, it is not present in DPDK. > Basically, In order to do this. > - Compile slow-path code(90% of DPDK) with minimal CPU instruction set support > - Have fastpath function compile with different CPU instruction set levels > -In slowpath, Attach the fastpath function pointer-based on CPU > instruction-level support. > > > > 3. So we build the DPDK program with -march=armv8-a+sve+crc (GCC 10.2). > > However, it is found that invalid instructions occur when the program > > runs on a machine that does not support SVE (pls see below). > > 4. The problem is caused by the introduction of SVE in GCC automatic vector > > optimization. > > > > So Is there a way to disable GCC automatic vector optimization or use only > > NEON to perform automatic vector optimization? > > > > BTW: we already test -fno-tree-vectorize (as link below) but found no effect. > > https://stackoverflow.com/questions/7778174/how-can-i-disable-vectorization-while-using-gcc > > > > > > The GDB output: > > EAL: Detected 128 lcore(s) > > EAL: Detected 4 NUMA nodes > > Option -w, --pci-whitelist is deprecated, use -a, --allow option instead > > > > Program received signal SIGILL, Illegal instruction. > > 0x0000000000671b88 in eal_adjust_config () > > (gdb) > > (gdb) where > > #0 0x0000000000671b88 in eal_adjust_config () > > #1 0x0000000000682840 in rte_eal_init () > > #2 0x000000000051c870 in main () > > (gdb) > > > > The disassembly output of eal_adjust_config: > > 671b7c: f8237a81 str x1, [x20, x3, lsl #3] > > 671b80: f110001f cmp x0, #0x400 > > 671b84: 54ffff21 b.ne 671b68 // b.any > > 671b88: 043357f5 addvl x21, x19, #-1 > > 671b8c: 043457e1 addvl x1, x20, #-1 > > 671b90: 910562b5 add x21, x21, #0x158 > > 671b94: 04e0e3e0 cntd x0 > > 671b98: 914012b5 add x21, x21, #0x4, lsl #12 > > 671b9c: 52800218 mov w24, #0x10 // #16 > > 671ba0: 25d8e3e1 ptrue p1.d > > 671ba4: 25f80fe0 whilelo p0.d, wzr, w24 > > 671ba8: a5e04020 ld1d {z0.d}, p0/z, [x1, x0, lsl #3] > > > > > > Best regards. > > Is there a way to use Gcc function multiversioning for this? https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html Not sure if this is only available on all compiler versions that DPDK claims to support. It looks like it made into GCC 6 and LLVM 7