hunk ./llvm-extra.cabal 95 - Build-Depends: cpuid >=0.2.3 && <0.3 + Build-Depends: + unsafe >=0.0 && <0.1, + cpuid >=0.2.3 && <0.3 hunk ./x86/cpuid/LLVM/Extra/ExtensionCheck/X86.hs 8 -import System.IO.Unsafe (unsafePerformIO, ) +import qualified System.Unsafe as Unsafe replace ./x86/cpuid/LLVM/Extra/ExtensionCheck/X86.hs [A-Za-z_0-9\-\.] unsafePerformIO Unsafe.performIO hunk ./Makefile 6 +ghci-cpuid: + ghci -Wall -i:src:x86/cpuid src/Run.hs + hunk ./Makefile 31 - llc -f $< + llc $< hunk ./llvm-extra.cabal 17 - * arithmetic operations with better type inference than the @llvm@ interface + * arithmetic operations with more general types + but better type inference than the @llvm@ interface hunk ./llvm-extra.cabal 52 -Tested-With: GHC==6.10.4, GHC==6.12.3, GHC==7.0.4 +Tested-With: GHC==6.10.4, GHC==6.12.3 +Tested-With: GHC==7.0.4, GHC==7.4.1, GHC==7.6.3 hunk ./src/LLVM/Extra/Extension/X86.hs 20 - cmpss, cmpps, cmpsd, cmppd, + cmpss, cmpps, cmpsd, cmppd, cmpps256, cmppd256, hunk ./src/LLVM/Extra/Extension/X86.hs 108 +cmpps256 :: Ext.T (FPPredicate -> X86.V8Float -> X86.V8Float -> CodeGenFunction r X86.V8Int32) +cmpps256 = fmap switchFPPred X86.cmpps256 + +cmppd256 :: Ext.T (FPPredicate -> X86.V4Double -> X86.V4Double -> CodeGenFunction r X86.V4Int64) +cmppd256 = fmap switchFPPred X86.cmppd256 + hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 6 - (CodeGenFunction, value, valueOf, Value, + (CodeGenFunction, valueOf, Value, hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 53 -if LLVM would support 'select' with bool vectors as condition. +but LLVM-3.1 crashes when actually doing this. hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 55 -min :: (IsFirstClass a, CmpRet a, CmpResult a ~ Bool) => +min :: (IsFirstClass a, CmpRet a) => hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 59 -max :: (IsFirstClass a, CmpRet a, CmpResult a ~ Bool) => +max :: (IsFirstClass a, CmpRet a) => hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 63 -abs :: (IsArithmetic a, CmpRet a, CmpResult a ~ Bool) => +abs :: (IsArithmetic a, CmpRet a) => hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 65 -abs x = do - b <- cmp CmpGE x (value LLVM.zero) - LLVM.select b x =<< LLVM.neg x +abs x = max x =<< LLVM.neg x hunk ./src/LLVM/Extra/ArithmeticPrivate.hs 89 - (IsFirstClass a, CmpRet a, CmpResult a ~ Bool) => - (Value a -> Value a -> CodeGenFunction r (Value Bool)) -> + (IsFirstClass a, CmpRet a) => + (Value a -> Value a -> CodeGenFunction r (Value (CmpResult a))) -> hunk ./src/LLVM/Extra/ScalarOrVector.hs 172 + -- | an alternative is using the 'Vector.Constant' vector type hunk ./src/LLVM/Extra/Extension.hs 145 -if an additional condition is given. +if an additional condition is satisfied.