[Git][ghc/ghc][master] Document the (x86) SIMD macros.

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Aug 22 03:16:53 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
7e02111b by Andreas Klebinger at 2024-08-21T23:16:15-04:00
Document the (x86) SIMD macros.

Fixes #25021.

- - - - -


2 changed files:

- compiler/GHC/SysTools/Cpp.hs
- docs/users_guide/phases.rst


Changes:

=====================================
compiler/GHC/SysTools/Cpp.hs
=====================================
@@ -106,6 +106,9 @@ command line looks like:
 -- See Note [Preprocessing invocations].
 --
 -- UnitEnv is needed to compute MIN_VERSION macros
+--
+-- If you change the macros defined by this function make sure to update the
+-- user guide.
 doCpp :: Logger -> TmpFs -> DynFlags -> UnitEnv -> CppOpts -> FilePath -> FilePath -> IO ()
 doCpp logger tmpfs dflags unit_env opts input_fn output_fn = do
     let hscpp_opts = picPOpts dflags


=====================================
docs/users_guide/phases.rst
=====================================
@@ -523,7 +523,7 @@ defined by your local GHC installation, the following trick is useful:
 ``arch_HOST_ARCH=1``
     This define allows conditional compilation based on the host
     architecture, where⟨arch⟩ is the name of the current architecture
-    (eg. ``i386``, ``x86_64``, ``powerpc``, ``sparc``, etc.).
+    (eg. ``i386``, ``x86_64``, ``aarch64``, ``powerpc``, ``sparc``, etc.).
 
 ``VERSION_pkgname``
     This macro is available starting GHC 8.0.  It is defined for every
@@ -539,6 +539,16 @@ defined by your local GHC installation, the following trick is useful:
     later.  It is identical in behavior to the ``MIN_VERSION_pkgname``
     macros that Cabal defines.
 
+SIMD macros
+    .. index::
+        single: SIMD Macros
+
+    These are defined conditionally based on the SIMD
+    flags used for compilation:
+
+    ``__SSE__``, ``__SSE2__``, ``__SSE4_2__``, ``__FMA__``,
+    ``__AVX__``, ``__AVX2__``, ``__AVX512CD__``, ``__AVX512ER__``, ``__AVX512F__``, ``__AVX512PF__``,
+
 .. _cpp-string-gaps:
 
 CPP and string gaps



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7e02111b71609bd4859d09c23482ea947fc35729

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7e02111b71609bd4859d09c23482ea947fc35729
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240821/94f4b730/attachment-0001.html>


More information about the ghc-commits mailing list