summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/Llvm
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2010-06-28 14:40:37 +0000
committerDavid Terei <davidterei@gmail.com>2010-06-28 14:40:37 +0000
commit20ea4cf4993aa7b0b19c882fd98503a4b7f307d3 (patch)
tree4be96b4987f6591205f3a7cedb07a39f4e4ae602 /compiler/llvmGen/Llvm
parent439cda45847149cb740e7e7a288c90c5e7743cf8 (diff)
downloadhaskell-20ea4cf4993aa7b0b19c882fd98503a4b7f307d3.tar.gz
LLVM: Update to use new fp ops introduced in 2.7
Diffstat (limited to 'compiler/llvmGen/Llvm')
-rw-r--r--compiler/llvmGen/Llvm/Types.hs19
1 files changed, 14 insertions, 5 deletions
diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs
index 4956d8d5af..af2ae9e22d 100644
--- a/compiler/llvmGen/Llvm/Types.hs
+++ b/compiler/llvmGen/Llvm/Types.hs
@@ -155,14 +155,16 @@ instance Show LlvmStatic where
show (LMAdd s1 s2)
= let ty1 = getStatType s1
+ op = if isFloat ty1 then " fadd (" else " add ("
in if ty1 == getStatType s2
- then show ty1 ++ " add (" ++ show s1 ++ "," ++ show s2 ++ ")"
+ then show ty1 ++ op ++ show s1 ++ "," ++ show s2 ++ ")"
else error $ "LMAdd with different types! s1: "
++ show s1 ++ ", s2: " ++ show s2
show (LMSub s1 s2)
= let ty1 = getStatType s1
+ op = if isFloat ty1 then " fsub (" else " sub ("
in if ty1 == getStatType s2
- then show ty1 ++ " sub (" ++ show s1 ++ "," ++ show s2 ++ ")"
+ then show ty1 ++ op ++ show s1 ++ "," ++ show s2 ++ ")"
else error $ "LMSub with different types! s1: "
++ show s1 ++ ", s2: " ++ show s2
@@ -636,10 +638,14 @@ data LlvmMachOp
| LM_MO_Mul -- ^ multiply ..
| LM_MO_UDiv -- ^ unsigned integer or vector division.
| LM_MO_SDiv -- ^ signed integer ..
- | LM_MO_FDiv -- ^ floating point ..
| LM_MO_URem -- ^ unsigned integer or vector remainder (mod)
| LM_MO_SRem -- ^ signed ...
- | LM_MO_FRem -- ^ floating point ...
+
+ | LM_MO_FAdd -- ^ add two floating point or vector values.
+ | LM_MO_FSub -- ^ subtract two ...
+ | LM_MO_FMul -- ^ multiply ...
+ | LM_MO_FDiv -- ^ divide ...
+ | LM_MO_FRem -- ^ remainder ...
-- | Left shift
| LM_MO_Shl
@@ -662,9 +668,12 @@ instance Show LlvmMachOp where
show LM_MO_Mul = "mul"
show LM_MO_UDiv = "udiv"
show LM_MO_SDiv = "sdiv"
- show LM_MO_FDiv = "fdiv"
show LM_MO_URem = "urem"
show LM_MO_SRem = "srem"
+ show LM_MO_FAdd = "fadd"
+ show LM_MO_FSub = "fsub"
+ show LM_MO_FMul = "fmul"
+ show LM_MO_FDiv = "fdiv"
show LM_MO_FRem = "frem"
show LM_MO_Shl = "shl"
show LM_MO_LShr = "lshr"