on master help sign in
Merge pull request #419 from Ralith/fix-llvm-fixed-width-compares
700f7d7Edwin Brady
@@ -78,6 +78,8 @@ installLLVMLib verbosity pkg local copy =
78 let idir = datadir $ L.absoluteInstallDirs pkg local copy in
78 let idir = datadir $ L.absoluteInstallDirs pkg local copy in
79 make verbosity ["-C", "llvm", "install", "TARGET=" ++ idir </> "llvm"]
79 make verbosity ["-C", "llvm", "install", "TARGET=" ++ idir </> "llvm"]
80
80
81+buildLLVMLib verbosity = make verbosity ["-C", "llvm", "all"]
82+
81installJavaPom pkg local verbosity copy version = do
83installJavaPom pkg local verbosity copy version = do
82 putStrLn $ "Installing java pom template"
84 putStrLn $ "Installing java pom template"
83 let dir = datadir $ L.absoluteInstallDirs pkg local copy
85 let dir = datadir $ L.absoluteInstallDirs pkg local copy
@@ -169,6 +171,7 @@ main = do
169 cleanJavaPom verb
171 cleanJavaPom verb
170 , postBuild = \ _ flags _ lbi -> do
172 , postBuild = \ _ flags _ lbi -> do
171 let verb = S.fromFlag $ S.buildVerbosity flags
173 let verb = S.fromFlag $ S.buildVerbosity flags
174+ when (llvmFlag $ configFlags lbi) (buildLLVMLib verb)
172 let withoutEffects = noEffectsFlag $ configFlags lbi
175 let withoutEffects = noEffectsFlag $ configFlags lbi
173 checkStdLib lbi withoutEffects verb
176 checkStdLib lbi withoutEffects verb
174 }
177 }
idris.cabal+1−1
@@ -295,6 +295,6 @@ Executable idris
295 if flag(LLVM)
295 if flag(LLVM)
296 other-modules: IRTS.CodegenLLVM
296 other-modules: IRTS.CodegenLLVM
297 cpp-options: -DIDRIS_LLVM
297 cpp-options: -DIDRIS_LLVM
298− build-depends: llvm-general>=3.3.4.1 && <3.3.4.5
298+ build-depends: llvm-general==3.3.5.*
299 else
299 else
300 other-modules: Util.LLVMStubs
300 other-modules: Util.LLVMStubs
src/IRTS/CodegenLLVM.hs+8−5
@@ -14,7 +14,10 @@ import LLVM.General.Context
14import LLVM.General.Diagnostic
14import LLVM.General.Diagnostic
15import LLVM.General.AST
15import LLVM.General.AST
16import LLVM.General.AST.AddrSpace
16import LLVM.General.AST.AddrSpace
17−import LLVM.General.Target
17+import LLVM.General.Target ( TargetMachine
18+ , withTargetOptions, withTargetMachine, getTargetMachineDataLayout
19+ , initializeAllTargets, lookupTarget
20+ )
18import LLVM.General.AST.DataLayout
21import LLVM.General.AST.DataLayout
19import LLVM.General.PassManager
22import LLVM.General.PassManager
20import qualified LLVM.General.Module as M
23import qualified LLVM.General.Module as M
@@ -895,11 +898,11 @@ cgOp (LZExt (ITFixed from) (ITFixed to)) [x]
895cgOp (LSExt (ITFixed from) (ITFixed to)) [x]
898cgOp (LSExt (ITFixed from) (ITFixed to)) [x]
896 | nativeTyWidth from < nativeTyWidth to = iCoerce SExt from to x
899 | nativeTyWidth from < nativeTyWidth to = iCoerce SExt from to x
897
900
898−cgOp (LLt (ATInt ity)) [x,y] = iCmp ity IPred.SLT x y
901+cgOp (LLt (ATInt ity)) [x,y] = iCmp ity IPred.ULT x y
899−cgOp (LLe (ATInt ity)) [x,y] = iCmp ity IPred.SLE x y
902+cgOp (LLe (ATInt ity)) [x,y] = iCmp ity IPred.ULE x y
900cgOp (LEq (ATInt ity)) [x,y] = iCmp ity IPred.EQ x y
903cgOp (LEq (ATInt ity)) [x,y] = iCmp ity IPred.EQ x y
901−cgOp (LGe (ATInt ity)) [x,y] = iCmp ity IPred.SGE x y
904+cgOp (LGe (ATInt ity)) [x,y] = iCmp ity IPred.UGE x y
902−cgOp (LGt (ATInt ity)) [x,y] = iCmp ity IPred.SGT x y
905+cgOp (LGt (ATInt ity)) [x,y] = iCmp ity IPred.UGT x y
903cgOp (LPlus (ATInt ity)) [x,y] = ibin ity x y (Add False False)
906cgOp (LPlus (ATInt ity)) [x,y] = ibin ity x y (Add False False)
904cgOp (LMinus (ATInt ity)) [x,y] = ibin ity x y (Sub False False)
907cgOp (LMinus (ATInt ity)) [x,y] = ibin ity x y (Sub False False)
905cgOp (LTimes (ATInt ity)) [x,y] = ibin ity x y (Mul False False)
908cgOp (LTimes (ATInt ity)) [x,y] = ibin ity x y (Mul False False)