[commit: ghc] wip/angerman/llvmng: CodeGen, support memcpy (8116657)
git at git.haskell.org
git at git.haskell.org
Sat Nov 18 03:37:31 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/angerman/llvmng
Link : http://ghc.haskell.org/trac/ghc/changeset/811665750421c7e18cf90b6e6aef90d2bda1d60f/ghc
>---------------------------------------------------------------
commit 811665750421c7e18cf90b6e6aef90d2bda1d60f
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date: Thu Nov 16 21:05:32 2017 +0800
CodeGen, support memcpy
>---------------------------------------------------------------
811665750421c7e18cf90b6e6aef90d2bda1d60f
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