[patch #8727] AX_EXT(ax_ext.m4) support for AVX2/AVX512 and other CPU extensions

Michael Petch <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.archive-maintainers
Message-ID <[email protected]>
URL:
  <http://savannah.gnu.org/patch/?8727>

                 Summary: AX_EXT(ax_ext.m4) support for AVX2/AVX512 and other
CPU extensions
                 Project: GNU Autoconf Archive
            Submitted by: mdpetch
            Submitted on: Tue 25 Aug 2015 23:56:36 MDT
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Attached is a patch for AX_EXT(ax_ext.m4) that should remain backwards
compatible with the current version (serial 13) in git with support for
AVX/AVX2/AVX512 as well as existing SIMD extensions. There is also a new
environment variable returned - AC_SUBST(CPUEXT_FLAGS) . CPUEXT_FLAGS works in
the same fashion as SIMD_FLAGS except it contains a list of GCC compiler
options to enable the non-SIMD extensions that a processor may support.

Proper OS and CPU checking is performed as well as a compiler test.

This patch really needs to be tested on newer architectures as I didn't have
access to AVX2 and AVX512 systems. The checks are based upon information
gathered across Intel specifications. This type of functionality has been
requested a lot over the past year so anyone who stumbles on this patch
submission can try it out.

The defines current supported are: 

AH_TEMPLATE([HAVE_MMX],[Define to 1 to support Multimedia Extensions])
  AH_TEMPLATE([HAVE_RDRND],[Define to 1 to support Digital Random Number
Generator])
  AH_TEMPLATE([HAVE_BMI1],[Define to 1 to support Bit Manipulation
Instruction Set 1])
  AH_TEMPLATE([HAVE_BMI2],[Define to 1 to support Bit Manipulation
Instruction Set 2])
  AH_TEMPLATE([HAVE_ADX],[Define to 1 to support Multi-Precision
Add-Carry Instruction Extensions])
  AH_TEMPLATE([HAVE_MPX],[Define to 1 to support Memory Protection
Extensions])
  AH_TEMPLATE([HAVE_PREFETCHWT1],[Define to 1 to support Prefetch Vector
Data Into Caches WT1])
  AH_TEMPLATE([HAVE_ABM],[Define to 1 to support Advanced Bit Manipulation])
  AH_TEMPLATE([HAVE_SSE],[Define to 1 to support Streaming SIMD Extensions])
  AH_TEMPLATE([HAVE_SSE2],[Define to 1 to support Streaming SIMD
Extensions])
  AH_TEMPLATE([HAVE_SSE3],[Define to 1 to support Streaming SIMD
Extensions 3])
  AH_TEMPLATE([HAVE_SSSE3],[Define to 1 to support Supplemental
Streaming SIMD Extensions 3])
  AH_TEMPLATE([HAVE_SSE4_1],[Define to 1 to support Streaming SIMD
Extensions 4.1])
  AH_TEMPLATE([HAVE_SSE4_2],[Define to 1 to support Streaming SIMD
Extensions 4.2])
  AH_TEMPLATE([HAVE_SSE4a],[Define to 1 to support AMD Streaming SIMD
Extensions 4a])
  AH_TEMPLATE([HAVE_SHA],[Define to 1 to support Secure Hash Algorithm
Extension])
  AH_TEMPLATE([HAVE_AES],[Define to 1 to support Advanced Encryption
Standard New Instruction Set (AES-NI)])
  AH_TEMPLATE([HAVE_AVX],[Define to 1 to support Advanced Vector
Extensions])
  AH_TEMPLATE([HAVE_FMA3],[Define to 1 to support  Fused Multiply-Add
Extensions 3])
  AH_TEMPLATE([HAVE_FMA4],[Define to 1 to support Fused Multiply-Add
Extensions 3])
  AH_TEMPLATE([HAVE_XOP],[Define to 1 to support eXtended Operations
Extensions])
  AH_TEMPLATE([HAVE_AVX2],[Define to 1 to support Advanced Vector
Extensions 2])
  AH_TEMPLATE([HAVE_AVX512_F],[Define to 1 to support AVX-512 Foundation
Extensions])
  AH_TEMPLATE([HAVE_AVX512_CD],[Define to 1 to support AVX-512 Conflict
Detection Instructions])
  AH_TEMPLATE([HAVE_AVX512_PF],[Define to 1 to support AVX-512 Conflict
Prefetch Instructions])
  AH_TEMPLATE([HAVE_AVX512_ER],[Define to 1 to support AVX-512
Exponential & Reciprocal Instructions])
  AH_TEMPLATE([HAVE_AVX512_VL],[Define to 1 to support AVX-512 Vector
Length Extensions])
  AH_TEMPLATE([HAVE_AVX512_BW],[Define to 1 to support AVX-512 Byte and
Word Instructions])
  AH_TEMPLATE([HAVE_AVX512_DQ],[Define to 1 to support AVX-512
Doubleword and Quadword Instructions])
  AH_TEMPLATE([HAVE_AVX512_IFMA],[Define to 1 to support AVX-512 Integer
Fused Multiply Add Instructions])
  AH_TEMPLATE([HAVE_AVX512_VBMI],[Define to 1 to support AVX-512 Vector
Byte Manipulation Instructions])



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 25 Aug 2015 23:56:36 MDT  Name: ax_ext.patch  Size: 20kB   By:
mdpetch
ax_ext.m4 patch to be applied to Serial 13 to support AVX/AVX/AVX512
<http://savannah.gnu.org/patch/download.php?file_id=34731>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8727>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.