Constant
public struct Constant<Repr> : IRConstant where Repr : ConstantRepresentation
A Constant represents a value initialized to a constant. Constant values
may be manipulated with standard Swift arithmetic operations and used with
standard IR Builder instructions like any other operand. The difference
being any instructions acting solely on constants and any arithmetic
performed on constants is evaluated at compile-time only.
Constants keep track of the values they represent at the type level to
disallow mixed-type arithmetic. Use the cast family of operations to
safely convert constants to other representations.
-
Retrieves the underlying LLVM constant object.
Declaration
Swift
public func asLLVM() -> LLVMValueRef
-
Creates a constant negate operation to negate a value.
Declaration
Swift
public static func negate(_ lhs: Constant<Signed>, overflowBehavior: OverflowBehavior = .default) -> Constant<Signed>Parameters
lhsThe operand to negate.
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the negation of the given constant.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public static func add(_ lhs: Constant<Unsigned>, _ rhs: Constant<Unsigned>, overflowBehavior: OverflowBehavior = .default) -> Constant<Unsigned>Parameters
lhsThe first summand value (the augend).
rhsThe second summand value (the addend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public static func add(_ lhs: Constant<Signed>, _ rhs: Constant<Signed>, overflowBehavior: OverflowBehavior = .default) -> Constant<Signed>Parameters
lhsThe first summand value (the augend).
rhsThe second summand value (the addend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Parameters
lhsThe first summand value (the augend).
rhsThe second summand value (the addend).
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public static func subtract(_ lhs: Constant<Unsigned>, _ rhs: Constant<Unsigned>, overflowBehavior: OverflowBehavior = .default) -> Constant<Unsigned>Parameters
lhsThe first value (the minuend).
rhsThe second value (the subtrahend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public static func subtract(_ lhs: Constant<Signed>, _ rhs: Constant<Signed>, overflowBehavior: OverflowBehavior = .default) -> Constant<Signed>Parameters
lhsThe first value (the minuend).
rhsThe second value (the subtrahend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Parameters
lhsThe first value (the minuend).
rhsThe second value (the subtrahend).
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public static func multiply(_ lhs: Constant<Unsigned>, _ rhs: Constant<Unsigned>, overflowBehavior: OverflowBehavior = .default) -> Constant<Unsigned>Parameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the product of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public static func multiply(_ lhs: Constant<Signed>, _ rhs: Constant<Signed>, overflowBehavior: OverflowBehavior = .default) -> Constant<Signed>Parameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the product of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Parameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
Return Value
A constant value representing the product of the two operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Parameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Parameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Parameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Parameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Parameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Parameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant bitwise logical not with the given integral value as an operand.
Declaration
Swift
public static func not<T>(_ lhs: Constant<T>) -> Constant<T> where T : IntegralConstantRepresentationParameters
valThe value to negate.
Return Value
A constant value representing the logical negation of the given operand.
-
A constant bitwise logical AND with the given values as operands.
Declaration
Swift
public static func and<T>(_ lhs: Constant<T>, _ rhs: Constant<T>) -> Constant<T> where T : IntegralConstantRepresentationParameters
lhsThe first operand.
rhsThe second operand.
nameThe name for the newly inserted instruction.
Return Value
A constant value representing the logical OR of the values of the two given operands.
-
A constant bitwise logical OR with the given values as operands.
Declaration
Swift
public static func or<T>(_ lhs: Constant<T>, _ rhs: Constant<T>) -> Constant<T> where T : IntegralConstantRepresentationParameters
lhsThe first operand.
rhsThe second operand.
nameThe name for the newly inserted instruction.
Return Value
A constant value representing the logical OR of the values of the two given operands.
-
A constant bitwise logical exclusive OR with the given values as operands.
Declaration
Swift
public static func xor<T>(_ lhs: Constant<T>, _ rhs: Constant<T>) -> Constant<T> where T : IntegralConstantRepresentationParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the exclusive OR of the values of the two given operands.
-
A constant left-shift of the first value by the second amount.
Declaration
Swift
public static func leftShift<T>(_ lhs: Constant<T>, _ rhs: Constant<T>) -> Constant<T> where T : IntegralConstantRepresentationParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the value of the first operand shifted left by the number of bits specified in the second operand.
-
A constant right-shift of the first value by the second amount.
Declaration
Swift
public static func rightShift<T>(_ lhs: Constant<T>, _ rhs: Constant<T>, arithmetic: Bool = true) -> Constant<T> where T : IntegralConstantRepresentationParameters
lhsThe first operand.
rhsThe second operand.
arithmeticShould the shift be arithmetic or logical (defaults to true)
Return Value
A constant value representing the value of the first operand shifted left by the number of bits specified in the second operand.
-
A constant select using the given condition to select among two values.
Declaration
Swift
public static func select<T, U>(_ cond: Constant<T>, then: Constant<U>, else: Constant<U>) -> Constant<U> where T : IntegralConstantRepresentation, U : ConstantRepresentationParameters
condThe condition to evaluate. It must have type
i1or be a vector ofi1.thenThe value to select if the given condition is true.
elseThe value to select if the given condition is false.
Return Value
A constant value representing the constant value selected for by the condition.
-
Creates a constant negate operation to negate a value.
Declaration
Swift
public func negate() -> ConstantReturn Value
A constant value representing the negation of the given constant.
-
Creates a constant negate operation to negate a value.
Declaration
Swift
public func negate() -> ConstantReturn Value
A constant value representing the negation of the given constant.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public func adding(_ rhs: Constant, overflowBehavior: OverflowBehavior = .default) -> ConstantParameters
rhsThe second summand value (the addend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public func adding(_ rhs: Constant, overflowBehavior: OverflowBehavior = .default) -> ConstantParameters
rhsThe second summand value (the addend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public func adding(_ rhs: Constant) -> ConstantParameters
rhsThe second summand value (the addend).
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public func subtracting(_ rhs: Constant, overflowBehavior: OverflowBehavior = .default) -> ConstantParameters
rhsThe second value (the subtrahend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public func subtracting(_ rhs: Constant, overflowBehavior: OverflowBehavior = .default) -> ConstantParameters
rhsThe second value (the subtrahend).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public func subtracting(_ rhs: Constant) -> ConstantParameters
rhsThe second value (the subtrahend).
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public func multiplying(_ rhs: Constant, overflowBehavior: OverflowBehavior = .default) -> ConstantParameters
rhsThe second factor value (the multiplicand).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the product of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public func multiplying(_ rhs: Constant, overflowBehavior: OverflowBehavior = .default) -> ConstantParameters
rhsThe second factor value (the multiplicand).
overflowBehaviorShould overflow occur, specifies the behavior of the resulting constant value.
Return Value
A constant value representing the product of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public func multiplying(_ rhs: Constant) -> ConstantParameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
Return Value
A constant value representing the product of the two operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public func dividing(by rhs: Constant) -> ConstantParameters
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public func dividing(by rhs: Constant) -> ConstantParameters
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public func dividing(by rhs: Constant) -> ConstantParameters
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public func remainder(_ rhs: Constant) -> ConstantParameters
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public func remainder(_ rhs: Constant) -> ConstantParameters
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public func remainder(_ rhs: Constant) -> ConstantParameters
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant equality comparison between two values.
Declaration
Swift
public static func equals(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than comparison between two values.
Declaration
Swift
public static func lessThan(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than comparison between two values.
Declaration
Swift
public static func greaterThan(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than-or-equal comparison between two values.
Declaration
Swift
public static func lessThanOrEqual(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than-or-equal comparison between two values.
Declaration
Swift
public static func greaterThanOrEqual(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than comparison between two values.
Declaration
Swift
public static func lessThan(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than comparison between two values.
Declaration
Swift
public static func greaterThan(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than-or-equal comparison between two values.
Declaration
Swift
public static func lessThanOrEqual(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than-or-equal comparison between two values.
Declaration
Swift
public static func greaterThanOrEqual(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant equality comparison between two values.
Declaration
Swift
public static func equals(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than comparison between two values.
Declaration
Swift
public static func lessThan(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than comparison between two values.
Declaration
Swift
public static func greaterThan(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than-or-equal comparison between two values.
Declaration
Swift
public static func lessThanOrEqual(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than-or-equal comparison between two values.
Declaration
Swift
public static func greaterThanOrEqual(_ lhs: Constant, _ rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
Creates a constant pointer-to-integer operation to convert the given constant global pointer value to the given integer type.
Declaration
Swift
public static func pointerToInt(_ val: IRConstant, _ intType: IntType) -> ConstantParameters
valThe pointer value.
intTypeThe destination integer type.
Return Value
An constant value representing the constant value of the given pointer converted to the given integer type.
-
Creates a constant operation retrieving the element at the index.
Declaration
Swift
public func getElement(indices: [Int]) -> IRConstantParameters
indicesA list of indices that indicate which of the elements of the aggregate object are indexed.
Return Value
The value in the struct at the provided index.
-
Build a constant
GEP(Get Element Pointer) instruction with a resultant value that is undefined if the address is outside the actual underlying allocated object and not the address one-past-the-end.The
GEPinstruction is often the source of confusion. LLVM provides a document to answer questions around its semantics and correct usage.Declaration
Swift
public func getElementPointer(indices: [IRConstant]) -> IRConstantParameters
indicesA list of indices that indicate which of the elements of the aggregate object are indexed.
Return Value
A value representing the address of a subelement of the given aggregate data structure value.
-
Build a GEP (Get Element Pointer) instruction.
The
GEPinstruction is often the source of confusion. LLVM provides a document to answer questions around its semantics and correct usage.Declaration
Swift
public func inBoundsGetElementPointer(indices: [IRConstant]) -> IRConstantParameters
indicesA list of indices that indicate which of the elements of the aggregate object are indexed.
Return Value
A value representing the address of a subelement of the given aggregate data structure value.
-
Builds a constant operation to construct a permutation of elements from the two given input vectors, returning a vector with the same element type as the inputs and length that is the same as the shuffle mask.
Declaration
Swift
public static func buildShuffleVector(_ vector1: Constant, and vector2: Constant, mask: Constant) -> ConstantParameters
vector1The first constant vector to shuffle.
vector2The second constant vector to shuffle.
maskA constant vector of
i32values that acts as a mask for the shuffled vectors.Return Value
A value representing a constant vector with the same element type as the inputs and length that is the same as the shuffle mask.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public static func + (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first summand value (the augend).
rhsThe second summand value (the addend).
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public static func - (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the minuend).
rhsThe second value (the subtrahend).
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public static func * (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
Return Value
A constant value representing the product of the two operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public static func / (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public static func % (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant equality comparison between two values.
Declaration
Swift
public static func == (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than comparison between two values.
Declaration
Swift
public static func < (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than comparison between two values.
Declaration
Swift
public static func > (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than-or-equal comparison between two values.
Declaration
Swift
public static func <= (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than-or-equal comparison between two values.
Declaration
Swift
public static func >= (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public static func + (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first summand value (the augend).
rhsThe second summand value (the addend).
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public static func - (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the minuend).
rhsThe second value (the subtrahend).
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public static func * (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
Return Value
A constant value representing the product of the two operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public static func / (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public static func % (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant equality comparison between two values.
Declaration
Swift
public static func == (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than comparison between two values.
Declaration
Swift
public static func < (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than comparison between two values.
Declaration
Swift
public static func > (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than-or-equal comparison between two values.
Declaration
Swift
public static func <= (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than-or-equal comparison between two values.
Declaration
Swift
public static func >= (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant bitwise logical OR with the given values as operands.
Declaration
Swift
public static func | (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the logical OR of the values of the two given operands.
-
A constant bitwise logical AND with the given values as operands.
Declaration
Swift
public static func & (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the logical OR of the values of the two given operands.
-
A constant left-shift of the first value by the second amount.
Declaration
Swift
public static func << (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the value of the first operand shifted left by the number of bits specified in the second operand.
-
A constant right-shift of the first value by the second amount.
Declaration
Swift
public static func >> (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the value of the first operand shifted left by the number of bits specified in the second operand.
-
Creates a constant add operation to add two homogenous constants together.
Declaration
Swift
public static func + (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first summand value (the augend).
rhsThe second summand value (the addend).
Return Value
A constant value representing the sum of the two operands.
-
Creates a constant sub operation to subtract two homogenous constants.
Declaration
Swift
public static func - (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the minuend).
rhsThe second value (the subtrahend).
Return Value
A constant value representing the difference of the two operands.
-
Creates a constant multiply operation with the given values as operands.
Declaration
Swift
public static func * (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first factor value (the multiplier).
rhsThe second factor value (the multiplicand).
Return Value
A constant value representing the product of the two operands.
-
A constant divide operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public static func / (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the quotient of the first and second operands.
-
A constant remainder operation that provides the remainder after divison of the first value by the second value.
Declaration
Swift
public static func % (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first value (the dividend).
rhsThe second value (the divisor).
Return Value
A constant value representing the remainder of division of the first operand by the second operand.
-
A constant equality comparison between two values.
Declaration
Swift
public static func == (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than comparison between two values.
Declaration
Swift
public static func < (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than comparison between two values.
Declaration
Swift
public static func > (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant less-than-or-equal comparison between two values.
Declaration
Swift
public static func <= (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant greater-than-or-equal comparison between two values.
Declaration
Swift
public static func >= (lhs: Constant, rhs: Constant) -> Constant<Signed>Parameters
lhsThe first value to compare.
rhsThe second value to compare.
Return Value
A constant integral value (i1) representing the result of the comparision of the given operands.
-
A constant bitwise logical OR with the given values as operands.
Declaration
Swift
public static func | (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the logical OR of the values of the two given operands.
-
A constant bitwise logical AND with the given values as operands.
Declaration
Swift
public static func & (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the logical OR of the values of the two given operands.
-
A constant left-shift of the first value by the second amount.
Declaration
Swift
public static func << (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the value of the first operand shifted left by the number of bits specified in the second operand.
-
A constant right-shift of the first value by the second amount.
Declaration
Swift
public static func >> (lhs: Constant, rhs: Constant) -> ConstantParameters
lhsThe first operand.
rhsThe second operand.
Return Value
A constant value representing the value of the first operand shifted left by the number of bits specified in the second operand.
-
A constant bitwise logical not with the given integral value as an operand.
Declaration
Swift
public prefix static func ! (lhs: Constant) -> ConstantParameters
valThe value to negate.
Return Value
A constant value representing the logical negation of the given operand.
-
Returns the special LLVM
undefvalue for this type.The
undefvalue can be used anywhere a constant is expected, and indicates that the user of the value may receive an unspecified bit-pattern.Declaration
Swift
public static func `undef`(_ ty: IntType) -> Constant
-
Returns the special LLVM
undefvalue for this type.The
undefvalue can be used anywhere a constant is expected, and indicates that the user of the value may receive an unspecified bit-pattern.Declaration
Swift
public static func `undef`(_ ty: FloatType) -> Constant
-
Returns the special LLVM
undefvalue for this type.The
undefvalue can be used anywhere a constant is expected, and indicates that the user of the value may receive an unspecified bit-pattern.Declaration
Swift
public static func `undef`(_ ty: StructType) -> Constant
-
Returns the special LLVM
undefvalue for this type.The
undefvalue can be used anywhere a constant is expected, and indicates that the user of the value may receive an unspecified bit-pattern.Declaration
Swift
public static func `undef`(_ ty: VectorType) -> Constant
Constant Structure Reference