[Git][ghc/ghc][wip/js-staging] 3 commits: Fix pdep (cgrun075)
Sylvain Henry (@hsyl20)
gitlab at gitlab.haskell.org
Mon Sep 26 11:19:06 UTC 2022
Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC
Commits:
e9831504 by Sylvain Henry at 2022-09-26T12:39:32+02:00
Fix pdep (cgrun075)
- - - - -
c1e516ea by Sylvain Henry at 2022-09-26T12:41:27+02:00
Fix error message (don't mention emscripten)
- - - - -
807a0131 by Sylvain Henry at 2022-09-26T13:22:17+02:00
Add Float/Word casts
- - - - -
3 changed files:
- compiler/GHC/Driver/Backend.hs
- libraries/base/jsbits/base.js
- rts/js/mem.js
Changes:
=====================================
compiler/GHC/Driver/Backend.hs
=====================================
@@ -463,7 +463,7 @@ backendDescription :: Backend -> String
backendDescription (Named NCG) = "native code generator"
backendDescription (Named LLVM) = "LLVM"
backendDescription (Named ViaC) = "compiling via C"
-backendDescription (Named JavaScript) = "compiling to JavaScript via emscripten"
+backendDescription (Named JavaScript) = "compiling to JavaScript"
backendDescription (Named Interpreter) = "byte-code interpreter"
backendDescription (Named NoBackend) = "no code generated"
=====================================
libraries/base/jsbits/base.js
=====================================
@@ -780,3 +780,28 @@ function h$stg_sig_install(sigNo, actionCode, sigSet_d, sigSet_o) {
// XXX dummy implementation
return 0;
}
+
+const h$word_float_conv_buf = new DataView(new ArrayBuffer(8));
+
+function h$stg_word32ToFloatzh(v) {
+ h$word_float_conv_buf.setUint32(0, v);
+ return h$word_float_conv_buf.getFloat32(0);
+}
+
+function h$stg_floatToWord32zh(v) {
+ h$word_float_conv_buf.setFloat32(0, v);
+ return h$word_float_conv_buf.getUint32(0);
+}
+
+function h$stg_word64ToDoublezh(h,l) {
+ h$word_float_conv_buf.setUint32(0, h);
+ h$word_float_conv_buf.setUint32(4, l);
+ return h$word_float_conv_buf.getFloat64(0);
+}
+
+function h$stg_doubleToWord64zh(v) {
+ h$word_float_conv_buf.setFloat64(0, v);
+ var l = h$word_float_conv_buf.getUint32(4);
+ var h = h$word_float_conv_buf.getUint32(0);
+ RETURN_UBX_TUP2(h,l);
+}
=====================================
rts/js/mem.js
=====================================
@@ -1338,7 +1338,7 @@ function h$pdep32(src, mask) {
k++;
}
}
- return dst;
+ return (dst >>> 0);
}
function h$pdep64(src_b, src_a, mask_b, mask_a) {
@@ -1360,7 +1360,7 @@ function h$pdep64(src_b, src_a, mask_b, mask_a) {
k++;
}
}
- RETURN_UBX_TUP2(dst_b, dst_a);
+ RETURN_UBX_TUP2((dst_b >>> 0), (dst_a >>> 0));
}
function h$pext8(src, mask) {
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fc880b1bed25ff401820d269821dd3d7eaafd358...807a0131c33b0e0457b484083154572070bf5b61
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fc880b1bed25ff401820d269821dd3d7eaafd358...807a0131c33b0e0457b484083154572070bf5b61
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/20220926/e2483ca1/attachment-0001.html>
More information about the ghc-commits
mailing list