[Git][ghc/ghc][wip/js-staging] 3 commits: Disable "debug" test

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Mon Oct 3 13:19:22 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
e97eb26c by Sylvain Henry at 2022-10-03T15:21:48+02:00
Disable "debug" test

- - - - -
7f8457af by Sylvain Henry at 2022-10-03T15:21:58+02:00
Implement copyMutableArray with overlap support

- - - - -
dca7ebbd by Sylvain Henry at 2022-10-03T15:22:28+02:00
Skip CmmSwitchTests

- - - - -


4 changed files:

- compiler/GHC/StgToJS/Prim.hs
- rts/js/mem.js
- testsuite/tests/codeGen/should_compile/all.T
- testsuite/tests/codeGen/should_run/all.T


Changes:

=====================================
compiler/GHC/StgToJS/Prim.hs
=====================================
@@ -541,7 +541,7 @@ genPrim prof ty op = case op of
         [ ma .! (Add i o2) |= a .! (Add i o1)
         , preIncrS i
         ]
-  CopyMutableArrayOp  -> \[]  [a1,o1,a2,o2,n] -> genPrim prof ty CopyArrayOp [] [a1,o1,a2,o2,n]
+  CopyMutableArrayOp  -> \[]  [a1,o1,a2,o2,n] -> PrimInline $ appS "h$copyMutableArray" [a1,o1,a2,o2,n]
   CloneArrayOp        -> \[r] [a,start,n]     -> PrimInline $ r |= app "h$sliceArray" [a,start,n]
   CloneMutableArrayOp -> \[r] [a,start,n]     -> genPrim prof ty CloneArrayOp [r] [a,start,n]
   FreezeArrayOp       -> \[r] [a,start,n]     -> PrimInline $ r |= app "h$sliceArray" [a,start,n]


=====================================
rts/js/mem.js
=====================================
@@ -533,6 +533,21 @@ function h$sliceArray(a, start, n) {
   return r;
 }
 
+// copy between two mutable arrays. Range may overlap
+function h$copyMutableArray(a1,o1,a2,o2,n) {
+  if (n <= 0) return;
+
+  if (o1 < o2) {
+    for (var i=n-1;i>=0;i--) { // start from the end to handle potential overlap
+      a2[o2+i] = a1[o1+i];
+    }
+  } else {
+    for (var i=0;i<n;i++) {
+      a2[o2+i] = a1[o1+i];
+    }
+  }
+}
+
 function h$memcpy() {
   if(arguments.length === 3) {  // ByteArray# -> ByteArray# copy
     var dst = arguments[0];


=====================================
testsuite/tests/codeGen/should_compile/all.T
=====================================
@@ -27,7 +27,12 @@ test('T9155', normal, compile, ['-O2'])
 test('T9303', normal, compile, ['-O2'])
 test('T9329', [when(unregisterised(), expect_broken(15467)), cmm_src], compile, ['-no-hs-main'])
 
-test('debug', normal, makefile_test, [])
+test('debug',
+  [ normal,
+    js_skip # requires Cmm
+  ],
+  makefile_test, [])
+
 test('T9964', normal, compile, ['-O'])
 test('T10518', [cmm_src], compile, ['-no-hs-main'])
 test('T10667', normal, compile, ['-g'])


=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -148,8 +148,8 @@ test('T9013', omit_ways(['ghci']),  # ghci doesn't support unboxed tuples
      compile_and_run, [''])
 test('T9340', normal, compile_and_run, [''])
 test('cgrun074', normal, compile_and_run, [''])
-test('CmmSwitchTest32', unless(wordsize(32), skip), compile_and_run, [''])
-test('CmmSwitchTest64', unless(wordsize(64), skip), compile_and_run, [''])
+test('CmmSwitchTest32', [unless(wordsize(32), skip),js_skip], compile_and_run, [''])
+test('CmmSwitchTest64', [unless(wordsize(64), skip),js_skip], compile_and_run, [''])
 # Skipping WAY=ghci, because it is not broken.
 test('T10245', normal, compile_and_run, [''])
 test('T10246', normal, compile_and_run, [''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cc9726781384cff4f46fd8b5a08529485ce40a7d...dca7ebbdcde465fe7458c4e14b7b77effbd81d51

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cc9726781384cff4f46fd8b5a08529485ce40a7d...dca7ebbdcde465fe7458c4e14b7b77effbd81d51
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/20221003/420c340f/attachment-0001.html>


More information about the ghc-commits mailing list