summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorchessai <chessai1996@gmail.com>2019-02-01 13:01:46 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-09 18:41:02 -0400
commitf737033329817335bc01ab16a385b4b5ec5b3b5d (patch)
treec437a8e0f813be553bec23b6cc9e9dd960707ddd /compiler/llvmGen
parenta018c3a84c88f6208e7bd5587af1cdf40c2ae991 (diff)
downloadhaskell-f737033329817335bc01ab16a385b4b5ec5b3b5d.tar.gz
Introduce log1p and expm1 primops
Previously log and exp were primitives yet log1p and expm1 were FFI calls. Fix this non-uniformity.
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/CodeGen.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index 236b26dbdf..28f38d09ec 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -745,7 +745,9 @@ cmmPrimOpFunctions mop = do
return $ case mop of
MO_F32_Exp -> fsLit "expf"
+ MO_F32_ExpM1 -> fsLit "expm1f"
MO_F32_Log -> fsLit "logf"
+ MO_F32_Log1P -> fsLit "log1pf"
MO_F32_Sqrt -> fsLit "llvm.sqrt.f32"
MO_F32_Fabs -> fsLit "llvm.fabs.f32"
MO_F32_Pwr -> fsLit "llvm.pow.f32"
@@ -767,7 +769,9 @@ cmmPrimOpFunctions mop = do
MO_F32_Atanh -> fsLit "atanhf"
MO_F64_Exp -> fsLit "exp"
+ MO_F64_ExpM1 -> fsLit "expm1"
MO_F64_Log -> fsLit "log"
+ MO_F64_Log1P -> fsLit "log1p"
MO_F64_Sqrt -> fsLit "llvm.sqrt.f64"
MO_F64_Fabs -> fsLit "llvm.fabs.f64"
MO_F64_Pwr -> fsLit "llvm.pow.f64"