[Git][ghc/ghc][wip/andreask/simd_test] Compile T25062 simd tests even if we can't run them.

Andreas Klebinger (@AndreasK) gitlab at gitlab.haskell.org
Fri Oct 4 15:19:48 UTC 2024



Andreas Klebinger pushed to branch wip/andreask/simd_test at Glasgow Haskell Compiler / GHC


Commits:
b16b01f1 by Andreas Klebinger at 2024-10-04T17:00:43+02:00
Compile T25062 simd tests even if we can't run them.

Helps avoid them being utterly broken.

Fixes #25341

- - - - -


2 changed files:

- testsuite/tests/simd/should_run/T25062_V64.hs
- testsuite/tests/simd/should_run/all.T


Changes:

=====================================
testsuite/tests/simd/should_run/T25062_V64.hs
=====================================
@@ -10,7 +10,7 @@ main =
   case foo ( \ x y -> plusDoubleX8# x y ) of
     v -> case unpackDoubleX8# v of
       (# d1, d2, d3, d4, d5, d6, d7, d8 #) ->
-        print [ D# d1, D# d2, D# d3, D# d4, D# d5, D# d6, D# d7, D# d8s ]
+        print [ D# d1, D# d2, D# d3, D# d4, D# d5, D# d6, D# d7, D# d8 ]
 
 {-# NOINLINE foo #-}
 foo :: ( DoubleX8# -> DoubleX8# -> DoubleX8# ) -> DoubleX8#


=====================================
testsuite/tests/simd/should_run/all.T
=====================================
@@ -58,13 +58,21 @@ test('simd014',
 test('T22187', [],compile,[''])
 test('T22187_run', [],compile_and_run,[''])
 test('T25062_V16', [], compile_and_run, [''])
-test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip)
-                   , only_ways(llvm_ways) # SIMD NCG TODO: support 256 bit wide vectors
-                   ]
-                 , compile_and_run, [''])
-test('T25062_V64', [ unless(have_cpu_feature('avx512f'), skip)
-                   , only_ways(llvm_ways) # SIMD NCG TODO: support 512 bit wide vectors
-                   ]
-                 , compile_and_run, [''])
+
+# Even if the CPU we run on doesn't support *executing* those tests we should try to
+# compile them.
+test('T25062_V32'
+    ,   [ extra_hc_opts('-mavx2')
+        , only_ways(llvm_ways) # SIMD NCG TODO: support 256 bit wide vectors
+        ]
+    , compile_and_run if have_cpu_feature('avx2') else compile
+    , [''])
+
+test('T25062_V64'
+    ,   [ extra_hc_opts('-mavx512f')
+        , only_ways(llvm_ways) # SIMD NCG TODO: support 256 bit wide vectors
+        ]
+    , compile_and_run if have_cpu_feature('avx512f') else compile
+    , [''])
 
 test('T25169', [], compile_and_run, [''])



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b16b01f1f91821ff6920ecbfb8e702f27107b017
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/20241004/89ee354b/attachment-0001.html>


More information about the ghc-commits mailing list