Simon Jakobi pushed to branch wip/sjakobi/T25450-march-native at Glasgow Haskell Compiler / GHC

Commits:

19 changed files:

Changes:

  • changelog.d/gcc-6-minimum
    1
    +section: packaging
    
    2
    +synopsis: ``configure`` now requires GCC 6 or newer when the C compiler is GCC.
    
    3
    +issues: #25450
    
    4
    +mrs: !16126

  • changelog.d/march-native
    1
    +section: compiler
    
    2
    +synopsis: Add :ghc-flag:`-march=native`, which on x86 and x86_64 enables the
    
    3
    +  CPU features of the machine running GHC.
    
    4
    +issues: #25450
    
    5
    +mrs: !16126

  • compiler/GHC/Driver/DynFlags.hs
    ... ... @@ -450,7 +450,7 @@ data DynFlags = DynFlags {
    450 450
       interactivePrint      :: Maybe String,
    
    451 451
     
    
    452 452
       -- Machine dependent flags (-m\<blah> stuff)
    
    453
    -  cpuFeatures           :: EnumSet CpuFeature, -- ^ The @-m\<feature\>@ flags that were passed.
    
    453
    +  cpuFeatures           :: EnumSet CpuFeature, -- ^ The CPU features requested by @-m...@ flags.
    
    454 454
                                                    -- See Note [CPU features] in GHC.Platform.CpuFeatures.
    
    455 455
       la664                 :: Bool, -- ^ Enable LA664 instructions
    
    456 456
     
    

  • compiler/GHC/Driver/Session.hs
    1 1
     {-# LANGUAGE CPP #-}
    
    2
    +{-# LANGUAGE MultiWayIf #-}
    
    2 3
     
    
    3 4
     -------------------------------------------------------------------------------
    
    4 5
     --
    
    ... ... @@ -228,6 +229,8 @@ import GHC.Platform.CpuFeatures
    228 229
     import GHC.Platform.Ways
    
    229 230
     import GHC.Platform.Profile
    
    230 231
     import GHC.Platform.ArchOS
    
    232
    +import GHC.Platform.Host (hostPlatformArch)
    
    233
    +import GHC.Platform.HostCpuFeatures (hostX86CpuFeatures)
    
    231 234
     
    
    232 235
     import GHC.Unit.Types
    
    233 236
     import GHC.Unit.Parser
    
    ... ... @@ -1737,6 +1740,7 @@ dynamic_flags_deps = [
    1737 1740
             (setDumpFlag Opt_D_dump_faststrings)
    
    1738 1741
     
    
    1739 1742
             ------ Machine dependent (-m<blah>) stuff ---------------------------
    
    1743
    +  , make_ord_flag defGhcFlag "march=native" (NoArg enableHostCpuFeatures)
    
    1740 1744
     
    
    1741 1745
       , make_ord_flag defGhcFlag "mla664"       (noArg (\d -> d { la664 = True }))
    
    1742 1746
     
    
    ... ... @@ -2863,6 +2867,17 @@ setDumpFlag dump_flag = NoArg (setDumpFlag' dump_flag)
    2863 2867
     setCpuFeature :: CpuFeature -> DynFlags -> DynFlags
    
    2864 2868
     setCpuFeature feat dflags = dflags { cpuFeatures = EnumSet.insert feat (cpuFeatures dflags) }
    
    2865 2869
     
    
    2870
    +-- | @-march=native@: enable the CPU features of the host GHC is running on.
    
    2871
    +enableHostCpuFeatures :: DynP ()
    
    2872
    +enableHostCpuFeatures = do
    
    2873
    +  arch <- platformArch . targetPlatform <$> liftEwM getCmdLineState
    
    2874
    +  if | arch /= ArchX86 && arch /= ArchX86_64
    
    2875
    +     -> addErr "-march=native is only supported on x86 and x86_64 targets"
    
    2876
    +     | arch /= hostPlatformArch
    
    2877
    +     -> addErr "-march=native is not supported when the target architecture differs from the host's"
    
    2878
    +     | otherwise
    
    2879
    +     -> upd $ \d -> d { cpuFeatures = cpuFeatures d `mappend` hostX86CpuFeatures }
    
    2880
    +
    
    2866 2881
     -- | The @-m\<feature\>@ flag for a 'CpuFeature'.
    
    2867 2882
     cpuFeatureFlagDep :: CpuFeature -> (Deprecation, Flag (CmdLineP DynFlags))
    
    2868 2883
     cpuFeatureFlagDep feat =
    

  • compiler/GHC/Platform/CpuFeatures.hs
    ... ... @@ -64,8 +64,9 @@ others:
    64 64
     
    
    65 65
     We keep two representations:
    
    66 66
     
    
    67
    -  A. 'DynFlags' records the set of flags that were passed, as an
    
    68
    -     'EnumSet' of 'CpuFeature'. Nothing is implied at this stage.
    
    67
    +  A. 'DynFlags' records the set of requested features, as an 'EnumSet' of
    
    68
    +     'CpuFeature': one per -m<feature> flag passed, plus the features of the
    
    69
    +     host under -march=native. Nothing is implied at this stage.
    
    69 70
     
    
    70 71
       B. 'initCpuFeatures' turns this set into a 'CpuFeatures' value, applying the
    
    71 72
          implications and the baseline of the target architecture. This
    

  • compiler/GHC/Platform/HostCpuFeatures.hs
    1
    +{-# LANGUAGE CPP #-}
    
    2
    +
    
    3
    +module GHC.Platform.HostCpuFeatures
    
    4
    +  ( hostX86CpuFeatures
    
    5
    +  ) where
    
    6
    +
    
    7
    +import GHC.Prelude
    
    8
    +
    
    9
    +import GHC.Data.EnumSet (EnumSet)
    
    10
    +import qualified GHC.Data.EnumSet as EnumSet
    
    11
    +import GHC.Platform.CpuFeatures (CpuFeature(..))
    
    12
    +
    
    13
    +import Data.Word (Word64)
    
    14
    +import System.IO.Unsafe (unsafePerformIO)
    
    15
    +
    
    16
    +#include "HostCpuFeaturesX86.h"
    
    17
    +
    
    18
    +#define GHC_X86_FEATURE_CONS(feat, cond) feat :
    
    19
    +
    
    20
    +-- | The features of the table in @HostCpuFeaturesX86.h@, in row order.
    
    21
    +probedX86CpuFeatures :: [CpuFeature]
    
    22
    +probedX86CpuFeatures = GHC_X86_PROBED_FEATURES(GHC_X86_FEATURE_CONS) []
    
    23
    +
    
    24
    +-- | The host's x86 CPU features.
    
    25
    +hostX86CpuFeatures :: EnumSet CpuFeature
    
    26
    +hostX86CpuFeatures = unsafePerformIO $ do
    
    27
    +  mask <- hostX86CpuFeatureMask
    
    28
    +  pure $ EnumSet.fromList
    
    29
    +    [ feat
    
    30
    +    | (bit, feat) <- zip [0 ..] probedX86CpuFeatures
    
    31
    +    , testBit mask bit
    
    32
    +    ]
    
    33
    +{-# NOINLINE hostX86CpuFeatures #-}
    
    34
    +
    
    35
    +#if defined(javascript_HOST_ARCH)
    
    36
    +hostX86CpuFeatureMask :: IO Word64
    
    37
    +hostX86CpuFeatureMask = pure 0
    
    38
    +#else
    
    39
    +foreign import ccall unsafe "ghc_host_x86_cpu_feature_mask"
    
    40
    +  hostX86CpuFeatureMask :: IO Word64
    
    41
    +#endif

  • compiler/HostCpuFeaturesX86.h
    1
    +/* The x86 features that -march=native probes. Each row pairs a CpuFeature
    
    2
    +   constructor with the C condition (see cbits/host_cpu_features_x86.c) that
    
    3
    +   detects the feature on the host. SSE and SSE2 are not probed: they are
    
    4
    +   GHC's x86 baseline.
    
    5
    +
    
    6
    +   Row i is bit i of the mask that ghc_host_x86_cpu_feature_mask returns and
    
    7
    +   GHC.Platform.HostCpuFeatures decodes, so the table can hold at most 64
    
    8
    +   rows. */
    
    9
    +#define GHC_X86_PROBED_FEATURES(F) \
    
    10
    +  F(Feat_SSE3,     SUPPORTS("sse3"))     \
    
    11
    +  F(Feat_SSSE3,    SUPPORTS("ssse3"))    \
    
    12
    +  F(Feat_SSE4,     SUPPORTS("sse4.1"))   \
    
    13
    +  F(Feat_SSE4_2,   SUPPORTS("sse4.2"))   \
    
    14
    +  F(Feat_AVX,      SUPPORTS("avx"))      \
    
    15
    +  F(Feat_AVX2,     SUPPORTS("avx2"))     \
    
    16
    +  F(Feat_AVX512F,  SUPPORTS("avx512f"))  \
    
    17
    +  F(Feat_AVX512BW, SUPPORTS("avx512bw")) \
    
    18
    +  F(Feat_AVX512CD, SUPPORTS("avx512cd")) \
    
    19
    +  F(Feat_AVX512DQ, SUPPORTS("avx512dq")) \
    
    20
    +  F(Feat_AVX512VL, SUPPORTS("avx512vl")) \
    
    21
    +  F(Feat_BMI,      SUPPORTS("bmi"))      \
    
    22
    +  F(Feat_BMI2,     SUPPORTS("bmi2"))     \
    
    23
    +  F(Feat_FMA,      SUPPORTS_FMA)         \
    
    24
    +  F(Feat_GFNI,     SUPPORTS_GFNI)

  • compiler/cbits/host_cpu_features_x86.c
    1
    +#include <HsFFI.h>
    
    2
    +
    
    3
    +/* Runtime x86 CPU feature detection backing GHC.Platform.HostCpuFeatures
    
    4
    +   (-march=native).
    
    5
    +
    
    6
    +   The __builtin_cpu_* calls below compile to references to libgcc/compiler-rt
    
    7
    +   symbols (__cpu_model & co.), which GHCi's runtime linker can only resolve
    
    8
    +   because the RTS exports them: see RTS_X86_CPU_MODEL_SYMBOLS in
    
    9
    +   rts/RtsSymbols.c. */
    
    10
    +
    
    11
    +#include "HostCpuFeaturesX86.h"
    
    12
    +
    
    13
    +#if defined(__i386__) || defined(__x86_64__)
    
    14
    +
    
    15
    +#define SUPPORTS(name) __builtin_cpu_supports(name)
    
    16
    +
    
    17
    +/* FMA is usable only when the OS saves the AVX register state.  However
    
    18
    +   compiler-rt's cpu_model/x86.c reports "fma" from the raw CPUID bit. */
    
    19
    +#define SUPPORTS_FMA (SUPPORTS("fma") && SUPPORTS("avx"))
    
    20
    +
    
    21
    +/* __builtin_cpu_supports accepts "gfni" from GCC 8 and LLVM 8 on. Apple
    
    22
    +   clang 11 is the first based on LLVM 8. Under an older bootstrap
    
    23
    +   compiler we report no GFNI.
    
    24
    +
    
    25
    +   "gfni" is read from __cpu_features2, which libgcc provides only from
    
    26
    +   GCC 8 on. Clang linking against an older libgcc is not detected here
    
    27
    +   and fails with an undefined reference to that symbol. */
    
    28
    +#if (defined(__clang_major__) && __clang_major__ >= 11) \
    
    29
    +    || (!defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8)
    
    30
    +#define SUPPORTS_GFNI SUPPORTS("gfni")
    
    31
    +#else
    
    32
    +#define SUPPORTS_GFNI 0
    
    33
    +#endif
    
    34
    +
    
    35
    +HsWord64 ghc_host_x86_cpu_feature_mask(void)
    
    36
    +{
    
    37
    +  __builtin_cpu_init();
    
    38
    +
    
    39
    +  HsWord64 mask = 0;
    
    40
    +  int bit = 0;
    
    41
    +
    
    42
    +#define GHC_X86_PROBE(feat, cond) \
    
    43
    +  if (cond) { mask |= (HsWord64)1 << bit; } \
    
    44
    +  bit++;
    
    45
    +
    
    46
    +  GHC_X86_PROBED_FEATURES(GHC_X86_PROBE)
    
    47
    +
    
    48
    +#undef GHC_X86_PROBE
    
    49
    +
    
    50
    +  return mask;
    
    51
    +}
    
    52
    +
    
    53
    +#else
    
    54
    +
    
    55
    +HsWord64 ghc_host_x86_cpu_feature_mask(void)
    
    56
    +{
    
    57
    +  return 0;
    
    58
    +}
    
    59
    +
    
    60
    +#endif

  • compiler/ghc.cabal.in
    ... ... @@ -32,6 +32,7 @@ extra-source-files:
    32 32
         GHC/Builtin/primops.txt.pp
    
    33 33
         Unique.h
    
    34 34
         CodeGen.Platform.h
    
    35
    +    HostCpuFeaturesX86.h
    
    35 36
         -- Shared with rts via hard-link at configure time. This is safer
    
    36 37
         -- for Windows, where symlinks don't work out of the box, so we
    
    37 38
         -- can't just commit some in git.
    
    ... ... @@ -186,6 +187,7 @@ Library
    186 187
           c-sources:
    
    187 188
             cbits/cutils.c
    
    188 189
             cbits/genSym.c
    
    190
    +        cbits/host_cpu_features_x86.c
    
    189 191
             cbits/keepCAFsForGHCi.c
    
    190 192
     
    
    191 193
         hs-source-dirs:
    
    ... ... @@ -691,6 +693,7 @@ Library
    691 693
             GHC.Platform.AArch64
    
    692 694
             GHC.Platform.Constants
    
    693 695
             GHC.Platform.CpuFeatures
    
    696
    +        GHC.Platform.HostCpuFeatures
    
    694 697
             GHC.Platform.LA64
    
    695 698
             GHC.Platform.NoRegs
    
    696 699
             GHC.Platform.PPC
    

  • docs/users_guide/expected-undocumented-flags.txt
    ... ... @@ -55,6 +55,7 @@
    55 55
     -instantiated-with
    
    56 56
     -keep-hi-file
    
    57 57
     -keep-o-file
    
    58
    +-march=native
    
    58 59
     -no-keep-hi-file
    
    59 60
     -no-keep-o-file
    
    60 61
     -no-link
    

  • docs/users_guide/using.rst
    ... ... @@ -1887,6 +1887,30 @@ Some flags only make sense for particular target platforms.
    1887 1887
         so this flag has no effect when used with the :ref:`native code generator <native-code-gen>`
    
    1888 1888
         or the :ref:`LLVM backend <llvm-code-gen>`.
    
    1889 1889
     
    
    1890
    +.. ghc-flag:: -march=native
    
    1891
    +    :shortdesc: (x86 only) Enable the CPU features of the host
    
    1892
    +    :type: dynamic
    
    1893
    +    :category: platform-options
    
    1894
    +
    
    1895
    +    (x86 only) Probe the CPU of the machine running GHC and enable the
    
    1896
    +    corresponding ``-m...`` CPU-feature options (for example ``-msse4.2``,
    
    1897
    +    ``-mavx2``, ``-mbmi2``, ``-mfma``). The detected features apply to both the
    
    1898
    +    :ref:`native code generator <native-code-gen>` and the
    
    1899
    +    :ref:`LLVM backend <llvm-code-gen>`.
    
    1900
    +
    
    1901
    +    The detected features are enabled in addition to any ``-m...`` options
    
    1902
    +    given explicitly, regardless of their order on the command line.
    
    1903
    +
    
    1904
    +    .. warning::
    
    1905
    +
    
    1906
    +        Code compiled with ``-march=native`` may use instructions that are not
    
    1907
    +        available on other CPUs, and is therefore not portable to a different
    
    1908
    +        machine.
    
    1909
    +
    
    1910
    +    The flag is rejected on other targets. A cross-compiler also rejects it
    
    1911
    +    when its target architecture differs from the one GHC itself runs on, since
    
    1912
    +    the probed CPU then says nothing about the target.
    
    1913
    +
    
    1890 1914
     Haddock
    
    1891 1915
     -------
    
    1892 1916
     
    

  • m4/fp_gcc_version.m4
    ... ... @@ -16,9 +16,10 @@ AC_DEFUN([FP_GCC_VERSION], [
    16 16
             AC_MSG_CHECKING([version of gcc])
    
    17 17
             fp_cv_gcc_version="`$CC -v 2>&1 | sed -n -e '1,/version /s/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/p'`"
    
    18 18
             AC_MSG_RESULT([$fp_cv_gcc_version])
    
    19
    -        # 4.7 is needed for __atomic_ builtins.
    
    20
    -        FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.7],
    
    21
    -                            [AC_MSG_ERROR([Need at least gcc version 4.7 (newer recommended)])])
    
    19
    +        # 6 is needed for the AVX-512 names of __builtin_cpu_supports, which
    
    20
    +        # -march=native probes.
    
    21
    +        FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [6],
    
    22
    +                            [AC_MSG_ERROR([Need at least gcc version 6 (newer recommended)])])
    
    22 23
         ])
    
    23 24
         AC_SUBST([GccVersion], [$fp_cv_gcc_version])
    
    24 25
       else
    

  • rts/RtsSymbols.c
    ... ... @@ -1050,6 +1050,35 @@ extern char **environ;
    1050 1050
     #define RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
    
    1051 1051
     #endif
    
    1052 1052
     
    
    1053
    +// libgcc/compiler-rt symbols behind __builtin_cpu_supports and
    
    1054
    +// __builtin_cpu_init, which compiler/cbits/host_cpu_features_x86.c uses
    
    1055
    +// (-march=native). Without them the runtime linker cannot load the ghc
    
    1056
    +// library's object code, e.g. for plugins in a statically linked GHCi.
    
    1057
    +#if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)
    
    1058
    +
    
    1059
    +// Weak: missing before GCC 8 and LLVM 8.
    
    1060
    +extern StgWord __cpu_features2[] __attribute__((weak));
    
    1061
    +
    
    1062
    +// Alpine's and Gentoo's musl GCCs patch __builtin_cpu_init to call this
    
    1063
    +// alias of __cpu_indicator_init. Weak: other musl toolchains lack it.
    
    1064
    +#if defined(linux_HOST_OS) && !defined(__GLIBC__)
    
    1065
    +extern void __cpu_indicator_init_local(void) __attribute__((weak));
    
    1066
    +#define RTS_X86_CPU_INIT_LOCAL_SYMBOLS \
    
    1067
    +      SymI_HasProto(__cpu_indicator_init_local)
    
    1068
    +#else
    
    1069
    +#define RTS_X86_CPU_INIT_LOCAL_SYMBOLS
    
    1070
    +#endif
    
    1071
    +
    
    1072
    +#define RTS_X86_CPU_MODEL_SYMBOLS \
    
    1073
    +      SymI_NeedsProto(__cpu_indicator_init) \
    
    1074
    +      SymI_NeedsDataProto(__cpu_model) \
    
    1075
    +      SymI_HasDataProto(__cpu_features2) \
    
    1076
    +      RTS_X86_CPU_INIT_LOCAL_SYMBOLS
    
    1077
    +
    
    1078
    +#else
    
    1079
    +#define RTS_X86_CPU_MODEL_SYMBOLS
    
    1080
    +#endif
    
    1081
    +
    
    1053 1082
     // Symbols defined by libc
    
    1054 1083
     #define RTS_LIBC_SYMBOLS                               \
    
    1055 1084
           SymI_HasProto_redirect(atexit, atexit, STRENGTH_STRONG, SYM_TYPE_CODE) /* See Note [Strong symbols] */ \
    
    ... ... @@ -1210,6 +1239,7 @@ RTS_OPENBSD_ONLY_SYMBOLS
    1210 1239
     RTS_LIBC_SYMBOLS
    
    1211 1240
     RTS_LIBGCC_SYMBOLS
    
    1212 1241
     RTS_ARCH_LIBGCC_SYMBOLS
    
    1242
    +RTS_X86_CPU_MODEL_SYMBOLS
    
    1213 1243
     RTS_FINI_ARRAY_SYMBOLS
    
    1214 1244
     RTS_LIBFFI_SYMBOLS
    
    1215 1245
     RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
    
    ... ... @@ -1265,6 +1295,7 @@ RtsSymbolVal const * getRtsSymbols(void) {
    1265 1295
                 RTS_OPENBSD_ONLY_SYMBOLS
    
    1266 1296
                 RTS_LIBGCC_SYMBOLS
    
    1267 1297
                 RTS_ARCH_LIBGCC_SYMBOLS
    
    1298
    +            RTS_X86_CPU_MODEL_SYMBOLS
    
    1268 1299
                 RTS_FINI_ARRAY_SYMBOLS
    
    1269 1300
                 RTS_LIBFFI_SYMBOLS
    
    1270 1301
                 RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
    

  • testsuite/tests/driver/Makefile
    ... ... @@ -500,6 +500,15 @@ withRtsOpts:
    500 500
     T3364:
    
    501 501
     	-"$(TEST_HC)" $(TEST_HC_OPTS) -H
    
    502 502
     
    
    503
    +# GHC and the C compiler should detect the same host CPU features.
    
    504
    +.PHONY: march_native_matches_cc
    
    505
    +march_native_matches_cc:
    
    506
    +	"$(TEST_HC)" $(TEST_HC_OPTS) -march=native -E -cpp march_native_matches_cc.hs -o ghc.out
    
    507
    +	"$(TEST_CC)" $(TEST_CC_OPTS) -march=native -E -x c march_native_matches_cc.hs > cc.out
    
    508
    +	sed -n 's/^\(feat [a-z0-9.]*\).*/\1/p' ghc.out > ghc.feats
    
    509
    +	sed -n 's/^\(feat [a-z0-9.]*\).*/\1/p' cc.out > cc.feats
    
    510
    +	diff -u ghc.feats cc.feats
    
    511
    +
    
    503 512
     .PHONY: T706
    
    504 513
     T706:
    
    505 514
     	cp T706a.hs T706.hs
    

  • testsuite/tests/driver/all.T
    ... ... @@ -223,6 +223,15 @@ test('T9938B', [], makefile_test, [])
    223 223
     test('T9963', exit_code(1), run_command,
    
    224 224
          ['{compiler} --interactive -ignore-dot-ghci --print-libdir'])
    
    225 225
     
    
    226
    +test('march_native_unsupported_arch',
    
    227
    +     [when(arch('x86_64') or arch('i386'), skip)],
    
    228
    +     compile_fail,
    
    229
    +     ['-march=native'])
    
    230
    +
    
    231
    +test('march_native_matches_cc',
    
    232
    +     [unless(arch('x86_64') or arch('i386'), skip), when(config.cross, skip)],
    
    233
    +     makefile_test, [])
    
    234
    +
    
    226 235
     test('T10219', normal, run_command,
    
    227 236
          # `-x hspp` in make mode should work.
    
    228 237
          # Note: need to specify `-x hspp` before the filename.
    

  • testsuite/tests/driver/march_native_matches_cc.hs
    1
    +-- BMI and BMI2 are not listed: GHC defines no macros for them.
    
    2
    +#if defined(__SSE3__)
    
    3
    +feat sse3
    
    4
    +#endif
    
    5
    +#if defined(__SSSE3__)
    
    6
    +feat ssse3
    
    7
    +#endif
    
    8
    +#if defined(__SSE4_1__)
    
    9
    +feat sse4.1
    
    10
    +#endif
    
    11
    +#if defined(__SSE4_2__)
    
    12
    +feat sse4.2
    
    13
    +#endif
    
    14
    +#if defined(__AVX__)
    
    15
    +feat avx
    
    16
    +#endif
    
    17
    +#if defined(__AVX2__)
    
    18
    +feat avx2
    
    19
    +#endif
    
    20
    +#if defined(__AVX512F__)
    
    21
    +feat avx512f
    
    22
    +#endif
    
    23
    +#if defined(__AVX512BW__)
    
    24
    +feat avx512bw
    
    25
    +#endif
    
    26
    +#if defined(__AVX512CD__)
    
    27
    +feat avx512cd
    
    28
    +#endif
    
    29
    +#if defined(__AVX512DQ__)
    
    30
    +feat avx512dq
    
    31
    +#endif
    
    32
    +#if defined(__AVX512VL__)
    
    33
    +feat avx512vl
    
    34
    +#endif
    
    35
    +#if defined(__FMA__)
    
    36
    +feat fma
    
    37
    +#endif
    
    38
    +#if defined(__GFNI__)
    
    39
    +feat gfni
    
    40
    +#endif

  • testsuite/tests/driver/march_native_unsupported_arch.hs
    1
    +module M where

  • testsuite/tests/driver/march_native_unsupported_arch.stderr
    1
    +ghc: on the commandline: -march=native is only supported on x86 and x86_64 targets
    
    2
    +Usage: For basic information, try the `--help' option.

  • testsuite/tests/rts/symbols/Main.hs
    ... ... @@ -31,6 +31,13 @@ ignoreSymbols = S.fromList [
    31 31
           "__umoddi3",
    
    32 32
           "__umodti3",
    
    33 33
     
    
    34
    +      -- Defined in libgcc/compiler-rt. RtsSymbols.c declares them on x86 only
    
    35
    +      -- (+Declared)
    
    36
    +      "__cpu_features2",
    
    37
    +      "__cpu_indicator_init",
    
    38
    +      "__cpu_indicator_init_local",
    
    39
    +      "__cpu_model",
    
    40
    +
    
    34 41
           -- These may be a CPP mismatch between rts/prim/vectorQuotRem.c and RtsSymbols.c
    
    35 42
           "hs_quotInt16X8",
    
    36 43
           "hs_quotInt32X4",