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

Safe HaskellNone

LLVM.Core.Guided

Synopsis

Documentation

data Guide shape elem Source

Instances

Functor (Guide shape) 

getElementPtr :: (ValueCons value, GetElementPtr o i, IsIndexType i0) => Guide shape (Ptr o, i0) -> VT value shape (Ptr o) -> (VT value shape i0, i) -> CodeGenFunction r (VT value shape (Ptr (ElementPtrType o i)))Source

getElementPtr0 :: (ValueCons value, GetElementPtr o i) => Guide shape (Ptr o) -> VT value shape (Ptr o) -> i -> CodeGenFunction r (VT value shape (Ptr (ElementPtrType o i)))Source

trunc :: (ValueCons value, IsInteger av, IsInteger bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv, IsSized a, IsSized b, SizeOf a :>: SizeOf b) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Truncate a value to a shorter bit width.

ext :: (ValueCons value, IsInteger a, IsInteger b, IsType bv, Signed a ~ Signed b, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv, IsSized a, IsSized b, SizeOf a :<: SizeOf b) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Extend a value to wider width. If the target type is signed, then preserve the sign, If the target type is unsigned, then extended by zeros.

extBool :: (ValueCons value, IsInteger b, IsType bv, IsPrimitive b, Type shape Bool ~ av, Type shape b ~ bv) => Guide shape (Bool, b) -> value av -> CodeGenFunction r (value bv)Source

zadapt :: (ValueCons value, IsInteger a, IsInteger b, IsType bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

It is zext, trunc or nop depending on the relation of the sizes.

sadapt :: (ValueCons value, IsInteger a, IsInteger b, IsType bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

It is sext, trunc or nop depending on the relation of the sizes.

adapt :: (ValueCons value, IsInteger a, IsInteger b, IsType bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv, Signed a ~ Signed b) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

It is sadapt or zadapt depending on the sign mode.

fptrunc :: (ValueCons value, IsFloating av, IsFloating bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv, IsSized a, IsSized b, SizeOf a :>: SizeOf b) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Truncate a floating point value.

fpext :: (ValueCons value, IsFloating av, IsFloating bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv, IsSized a, IsSized b, SizeOf a :<: SizeOf b) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Extend a floating point value.

fptoint :: (ValueCons value, IsFloating a, IsInteger b, IsType bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Convert a floating point value to an integer. It is mapped to fptosi or fptoui depending on the type a.

inttofp :: (ValueCons value, IsInteger a, IsFloating b, IsType bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Convert an integer to a floating point value. It is mapped to sitofp or uitofp depending on the type a.

ptrtoint :: (ValueCons value, IsType a, IsInteger b, IsType bv, IsPrimitive b, Type shape (Ptr a) ~ av, Type shape b ~ bv) => Guide shape (Ptr a, b) -> value av -> CodeGenFunction r (value bv)Source

Convert a pointer to an integer.

inttoptr :: (ValueCons value, IsInteger a, IsType b, IsType bv, IsPrimitive a, Type shape a ~ av, Type shape (Ptr b) ~ bv) => Guide shape (a, Ptr b) -> value av -> CodeGenFunction r (value bv)Source

Convert an integer to a pointer.

bitcast :: (ValueCons value, IsFirstClass a, IsFirstClass bv, IsPrimitive a, IsPrimitive b, Type shape a ~ av, Type shape b ~ bv, IsSized a, IsSized b, SizeOf a ~ SizeOf b) => Guide shape (a, b) -> value av -> CodeGenFunction r (value bv)Source

Convert between to values of the same size by just copying the bit pattern.

select :: (ValueCons value, IsPrimitive a, Type shape a ~ av, Type shape Bool ~ bv) => Guide shape a -> value bv -> value av -> value av -> CodeGenFunction r (value av)Source

cmp :: (ValueCons value, IsArithmetic a, IsPrimitive a, Type shape a ~ av, Type shape Bool ~ bv) => Guide shape a -> CmpPredicate -> value av -> value av -> CodeGenFunction r (value bv)Source

icmp :: (ValueCons value, IsIntegerOrPointer a, IsPrimitive a, Type shape a ~ av, Type shape Bool ~ bv) => Guide shape a -> IntPredicate -> value av -> value av -> CodeGenFunction r (value bv)Source

Deprecated: use cmp or pcmp instead

Compare integers.

pcmp :: (ValueCons value, Type shape (Ptr a) ~ av, Type shape Bool ~ bv) => Guide shape (Ptr a) -> IntPredicate -> value av -> value av -> CodeGenFunction r (value bv)Source

Compare pointers.

fcmp :: (ValueCons value, IsFloating a, IsPrimitive a, Type shape a ~ av, Type shape Bool ~ bv) => Guide shape a -> FPPredicate -> value av -> value av -> CodeGenFunction r (value bv)Source

Compare floating point values.