llvm-tf-12.0.0.1: Bindings to the LLVM compiler toolkit using type families.

Safe HaskellNone
LanguageHaskell98

LLVM.Util.Arithmetic

Contents

Synopsis

Documentation

type TValue r a = CodeGenFunction r (Value a) Source #

Synonym for CodeGenFunction r (Value a).

(%==) :: CmpRet a => TValue r a -> TValue r a -> TValue r (CmpResult a) infix 4 Source #

Comparison functions.

(%/=) :: CmpRet a => TValue r a -> TValue r a -> TValue r (CmpResult a) infix 4 Source #

Comparison functions.

(%<) :: CmpRet a => TValue r a -> TValue r a -> TValue r (CmpResult a) infix 4 Source #

Comparison functions.

(%<=) :: CmpRet a => TValue r a -> TValue r a -> TValue r (CmpResult a) infix 4 Source #

Comparison functions.

(%>) :: CmpRet a => TValue r a -> TValue r a -> TValue r (CmpResult a) infix 4 Source #

Comparison functions.

(%>=) :: CmpRet a => TValue r a -> TValue r a -> TValue r (CmpResult a) infix 4 Source #

Comparison functions.

(%&&) :: TValue r Bool -> TValue r Bool -> TValue r Bool infixr 3 Source #

Lazy and.

(%||) :: TValue r Bool -> TValue r Bool -> TValue r Bool infixr 2 Source #

Lazy or.

(?) :: IsFirstClass a => TValue r Bool -> (TValue r a, TValue r a) -> TValue r a infix 0 Source #

Conditional, returns first element of the pair when condition is true, otherwise second.

(??) :: (IsFirstClass a, CmpRet a) => TValue r (CmpResult a) -> (TValue r a, TValue r a) -> TValue r a infix 0 Source #

retrn :: TValue a a -> CodeGenFunction a () Source #

Return a value from an arithFunction.

set :: TValue r a -> CodeGenFunction r (TValue r a) Source #

Use x <- set $ ... to make a binding.

class (FunA r b ~ a, FunB a ~ b, CodeResult a ~ r) => ArithFunction r a b Source #

Minimal complete definition

arithFunction'

Instances
(ArithFunction r b0 b1, a0 ~ CodeGenFunction r a1) => ArithFunction r (a0 -> b0) (a1 -> b1) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Associated Types

type FunA r (a1 -> b1) :: Type

type FunB (a0 -> b0) :: Type

Methods

arithFunction' :: (a0 -> b0) -> a1 -> b1

(r ~ ra, r ~ rb, a ~ b) => ArithFunction r (CodeGenFunction ra a) (CodeGenFunction rb b) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Associated Types

type FunA r (CodeGenFunction rb b) :: Type

type FunB (CodeGenFunction ra a) :: Type

arithFunction :: (ArithFunction r a b, r ~ Result z, Return z b c) => a -> c Source #

Unlift a function with TValue to have Value arguments.

class (RetB a ~ b, CodeValue a ~ z, RetA z b ~ a) => Return z a b Source #

Turn (a -> b -> CodeGenFunction r c) into (a -> b -> CodeGenFunction r ()) for r ~ Result c

Minimal complete definition

addRet

Instances
(Return z b0 b1, a0 ~ a1) => Return z (a0 -> b0) (a1 -> b1) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Associated Types

type RetA z (a1 -> b1) :: Type

type RetB (a0 -> b0) :: Type

Methods

addRet :: (a0 -> b0) -> a1 -> b1

(Ret z, Result z ~ r, r ~ ra, r ~ rb, z ~ a, unit ~ ()) => Return z (CodeGenFunction ra a) (CodeGenFunction rb unit) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Associated Types

type RetA z (CodeGenFunction rb unit) :: Type

type RetB (CodeGenFunction ra a) :: Type

Methods

addRet :: CodeGenFunction ra a -> CodeGenFunction rb unit

class (TFunB r a ~ b, TFunA b ~ a, CodeResult b ~ r) => ToArithFunction r a b Source #

Minimal complete definition

toArithFunction'

Instances
Value a ~ b => ToArithFunction r (IO a) (CodeGenFunction r b) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Associated Types

type TFunA (CodeGenFunction r b) :: Type

type TFunB r (IO a) :: Type

Methods

toArithFunction' :: CodeGenFunction r (Call (IO a)) -> CodeGenFunction r b

(ToArithFunction r b0 b1, CodeGenFunction r (Value a0) ~ a1) => ToArithFunction r (a0 -> b0) (a1 -> b1) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Associated Types

type TFunA (a1 -> b1) :: Type

type TFunB r (a0 -> b0) :: Type

Methods

toArithFunction' :: CodeGenFunction r (Call (a0 -> b0)) -> a1 -> b1

toArithFunction :: ToArithFunction r f g => Function f -> g Source #

Lift a function from having Value arguments to having TValue arguments.

recursiveFunction :: (IsFunction f, FunctionArgs f, code ~ FunctionCodeGen f, ArithFunction r arith open, r ~ Result z, Return z open code, ToArithFunction r f g) => (g -> arith) -> CodeGenModule (Function f) Source #

Define a recursive arithFunction, gets passed itself as the first argument.

class CallIntrinsic a Source #

Minimal complete definition

callIntrinsic1', callIntrinsic2'

Instances
CallIntrinsic Double Source # 
Instance details

Defined in LLVM.Util.Arithmetic

CallIntrinsic Float Source # 
Instance details

Defined in LLVM.Util.Arithmetic

(Positive n, IsPrimitive a, CallIntrinsic a) => CallIntrinsic (Vector n a) Source # 
Instance details

Defined in LLVM.Util.Arithmetic

Methods

callIntrinsic1' :: String -> Value (Vector n a) -> TValue r (Vector n a)

callIntrinsic2' :: String -> Value (Vector n a) -> Value (Vector n a) -> TValue r (Vector n a)

Orphan instances

(IsArithmetic a, CmpRet a, Num a, IsConst a, Value a ~ av) => Enum (CodeGenFunction r av) Source # 
Instance details

Eq (CodeGenFunction r av) Source # 
Instance details

Methods

(==) :: CodeGenFunction r av -> CodeGenFunction r av -> Bool #

(/=) :: CodeGenFunction r av -> CodeGenFunction r av -> Bool #

(CmpRet a, CallIntrinsic a, Floating a, IsConst a, IsFloating a, Value a ~ av) => Floating (CodeGenFunction r av) Source # 
Instance details

(CmpRet a, Fractional a, IsConst a, IsFloating a, Value a ~ av) => Fractional (CodeGenFunction r av) Source # 
Instance details

(CmpRet a, Num a, IsConst a, IsInteger a, Value a ~ av) => Integral (CodeGenFunction r av) Source # 
Instance details

(IsArithmetic a, CmpRet a, Num a, IsConst a, Value a ~ av) => Num (CodeGenFunction r av) Source # 
Instance details

Ord (CodeGenFunction r av) Source # 
Instance details

(IsArithmetic a, CmpRet a, Num a, IsConst a, Value a ~ av) => Real (CodeGenFunction r av) Source # 
Instance details

(CmpRet a, CallIntrinsic a, RealFloat a, IsConst a, IsFloating a, Value a ~ av) => RealFloat (CodeGenFunction r av) Source # 
Instance details

(CmpRet a, Fractional a, IsConst a, IsFloating a, Value a ~ av) => RealFrac (CodeGenFunction r av) Source # 
Instance details

Methods

properFraction :: Integral b => CodeGenFunction r av -> (b, CodeGenFunction r av) #

truncate :: Integral b => CodeGenFunction r av -> b #

round :: Integral b => CodeGenFunction r av -> b #

ceiling :: Integral b => CodeGenFunction r av -> b #

floor :: Integral b => CodeGenFunction r av -> b #