FloatType

public struct FloatType : IRType
extension FloatType: Equatable

FloatType enumerates representations of a floating value of a particular bit width and semantics.

  • The kind of floating point type this is

    Declaration

    Swift

    public var kind: Kind
  • Returns the context associated with this type.

    Declaration

    Swift

    public let context: Context
  • Declaration

    Swift

    public init(kind: Kind, in context: Context = Context.global)

    Parameters

    kind

    The kind of floating point type to create

    context

    The context to create this type in

  • Enumerates the bitwidth and kind of supported floating point types.

    See more

    Declaration

    Swift

    public enum Kind
  • 16-bit floating point value in the global context

    Declaration

    Swift

    public static let half: FloatType
  • 32-bit floating point value in the global context

    Declaration

    Swift

    public static let float: FloatType
  • 64-bit floating point value in the global context

    Declaration

    Swift

    public static let double: FloatType
  • 80-bit floating point value (X87) in the global context

    Declaration

    Swift

    public static let x86FP80: FloatType
  • 128-bit floating point value (112-bit mantissa) in the global context

    Declaration

    Swift

    public static let fp128: FloatType
  • 128-bit floating point value (two 64-bits) in the global context

    Declaration

    Swift

    public static let ppcFP128: FloatType
  • Creates a constant floating value of this type from a Swift Double value.

    Declaration

    Swift

    public func constant(_ value: Double) -> Constant<Floating>

    Parameters

    value

    A Swift double value.

    Return Value

    A value representing a floating point constant initialized with the given Swift double value.

  • Creates a constant floating value of this type parsed from a string.

    Declaration

    Swift

    public func constant(_ value: String) -> Constant<Floating>

    Parameters

    value

    A string value containing a float.

    Return Value

    A value representing a constant initialized with the result of parsing the string as a floating point number.

  • Retrieves the underlying LLVM type object.

    Declaration

    Swift

    public func asLLVM() -> LLVMTypeRef
  • Declaration

    Swift

    public static func == (lhs: FloatType, rhs: FloatType) -> Bool