[commit: ghc] wip/angerman/llvmng: CodeGen, support memcpy (a8e690d)

git at git.haskell.org git at git.haskell.org
Fri Nov 17 11:24:42 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/angerman/llvmng
Link       : http://ghc.haskell.org/trac/ghc/changeset/a8e690d616c0b0c169f4ea9ea3a95b05b2540ba4/ghc

>---------------------------------------------------------------

commit a8e690d616c0b0c169f4ea9ea3a95b05b2540ba4
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Thu Nov 16 21:05:32 2017 +0800

    CodeGen, support memcpy


>---------------------------------------------------------------

a8e690d616c0b0c169f4ea9ea3a95b05b2540ba4
 compiler/llvmGen-ng/Data/BitCode/LLVM/Gen.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/llvmGen-ng/Data/BitCode/LLVM/Gen.hs b/compiler/llvmGen-ng/Data/BitCode/LLVM/Gen.hs
index ec5eb3f..c1c9e8c 100644
--- a/compiler/llvmGen-ng/Data/BitCode/LLVM/Gen.hs
+++ b/compiler/llvmGen-ng/Data/BitCode/LLVM/Gen.hs
@@ -1287,6 +1287,11 @@ getFunPtr blockMap regMap ty = \case
     MO_F64_Sinh -> EDSL.fun "sinh"          =<< [EDSL.f64] --> EDSL.f64
     MO_F64_Cosh -> EDSL.fun "cosh"          =<< [EDSL.f64] --> EDSL.f64
     MO_F64_Tanh -> EDSL.fun "tanh"          =<< [EDSL.f64] --> EDSL.f64
+    MO_Memcmp _ -> do
+      wordSize <- (*8) . wORD_SIZE <$> (lift getDynFlags)
+      EDSL.fun "memcmp"        =<< [ EDSL.i8ptr
+                                   , EDSL.i8ptr
+                                   , EDSL.i wordSize] --> EDSL.i32
 
     _           -> panic $ "getFunPtr \\w primOp: " ++ show mop
   _              -> panic "getFunPtr, unknown case not implemented!"



More information about the ghc-commits mailing list