From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67051 invoked by alias); 11 Jan 2017 00:56:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 66967 invoked by uid 89); 11 Jan 2017 00:56:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS,URIBL_RED autolearn=no version=3.3.2 spammy=cap, signedoffby, signed-off-by, 1LL X-HELO: mail-oi0-f67.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FkZOxI7N81BCiFGlMG5Uk7WOcB5P48uxRuJ45QxD4B8=; b=D0Co/O++mTM/7f+O5VF02LQWYi+KjmQIJwzlRr9FL8iJwTPGE3OF3JaDH+Gi4fgmVc K9LTjh/zLYP/vGVMpaoUCIuXQadhfWdBGCdWY5xlo1cYeNUwBrs6+LjCFtBvwYsabbKe rN0+zvwbNzbB+nE1ho9uugLtZGneQG3GZ25fcSi074HGZFwduqm3fodZXd7dHqkrEOEv 5G3PCRpZukKBTfzdVV8MFlYrGg4E4tTW9DWPqUrsSfPvrhEYy9eQIR7iJsvQ/bhYMg+D kKa3OWO8RrddIFlbG0FoXJms66sNjRhYM9Y9U03d/meOld23oPUeqCW92XjJQ2HngFtM adzw== X-Gm-Message-State: AIkVDXKG1MU2AuQNkTkoAwb3H2bg/wOfYKjlZ3So4O8K5VCymViX0dTTxrBdS0v0clbwHP43kYCjYVEtmWe+rg== X-Received: by 10.157.8.13 with SMTP id 13mr3108690oty.173.1484096184787; Tue, 10 Jan 2017 16:56:24 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20170103195311.22870-1-victor.rodriguez.bahena@intel.com> References: <20170103195311.22870-1-victor.rodriguez.bahena@intel.com> From: Victor Rodriguez Date: Wed, 11 Jan 2017 00:56:00 -0000 Message-ID: Subject: Re: [PATCH] Add avx2 fake-capability, like tls To: Victor Rodriguez Cc: libc-alpha@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017-01/txt/msg00183.txt.bz2 On Tue, Jan 3, 2017 at 1:53 PM, Victor Rodriguez wrote: > The idea of the patch is to provide AVX2 capability to glibc, original > patch from: Dimitri John Ledkov . > It has been proved that the use of AVX2 improves the performance of current > numerical applications. With this patch the Linux distributions will be able to > handle AVX2 in glibc > > Signed-off-by: Victor Rodriguez > --- > ChangeLog | 6 ++++++ > elf/dl-cache.c | 6 +++++- > elf/dl-hwcaps.c | 17 +++++++++++++++++ > elf/ldconfig.c | 1 + > 4 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/ChangeLog b/ChangeLog > index bbda2a7f2c..8a24afa918 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,9 @@ > +2016-12-30 Victor Rodriguez > + > + * elf/dl-cache: Define AVX platform > + * elf/dl-hwcaps.c : Adding avx2 cap support > + * elf/ldconfig.c : Add avx2 to hwcap_extra > + > 2016-12-31 Joseph Myers > > * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)] > diff --git a/elf/dl-cache.c b/elf/dl-cache.c > index cfa335eb32..ae5047046d 100644 > --- a/elf/dl-cache.c > +++ b/elf/dl-cache.c > @@ -259,8 +259,9 @@ _dl_load_cache_lookup (const char *name) > platform = 1ULL << platform; > > #define _DL_HWCAP_TLS_MASK (1LL << 63) > +#define _DL_HWCAP_AVX2_MASK (1LL << 62) > uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask)) > - | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK); > + | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK | _DL_HWCAP_AVX2_MASK); > > /* Only accept hwcap if it's for the right platform. */ > #define HWCAP_CHECK \ > @@ -271,6 +272,9 @@ _dl_load_cache_lookup (const char *name) > if (_DL_PLATFORMS_COUNT \ > && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \ > && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \ > + continue; \ > + if (!HAS_ARCH_FEATURE (AVX2_Usable) && \ > + (lib->hwcap & _DL_HWCAP_AVX2_MASK)) \ > continue > SEARCH_CACHE (cache_new); > } > diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c > index 6004ff264d..4e46b752e7 100644 > --- a/elf/dl-hwcaps.c > +++ b/elf/dl-hwcaps.c > @@ -111,6 +111,9 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz, > /* For TLS enabled builds always add 'tls'. */ > ++cnt; > > + /* Add 'avx2' capability on x86_64 */ > + ++cnt; > + > /* Create temporary data structure to generate result table. */ > struct r_strlenpair temp[cnt]; > m = 0; > @@ -163,6 +166,20 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz, > temp[m].len = 3; > ++m; > > + if (HAS_ARCH_FEATURE (AVX2_Usable)) > + { > + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) > + _dl_debug_printf (" adding avx2 cap support\n"); > + temp[m].str = "avx2"; > + temp[m].len = 4; > + ++m; > + } > + else { > + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) > + _dl_debug_printf (" not adding avx2 cap support\n"); > + --cnt; > + } > + > assert (m == cnt); > > /* Determine the total size of all strings together. */ > diff --git a/elf/ldconfig.c b/elf/ldconfig.c > index 467ca8266a..ee2121786c 100644 > --- a/elf/ldconfig.c > +++ b/elf/ldconfig.c > @@ -1298,6 +1298,7 @@ main (int argc, char **argv) > under which TLS support was optional. The entry is no longer needed, but > must remain for compatibility. */ > hwcap_extra[63 - _DL_FIRST_EXTRA] = "tls"; > + hwcap_extra[62 - _DL_FIRST_EXTRA] = "avx2"; > > set_hwcap (); > > -- > 2.11.0 > Hi team Is there any feedback from this ? Regards