Show / Hide Table of Contents

    Class ArithmeticIntrinsics

    Supports creating, recognizing and parsing arithmetic intrinsics.

    Inheritance
    System.Object
    ArithmeticIntrinsics
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Flame.Compiler.Instructions
    Assembly: Flame.Compiler.dll
    Syntax
    public static class ArithmeticIntrinsics

    Fields

    | Improve this Doc View Source

    CheckedNamespace

    The namespace for checked arithmetic intrinsics.

    Declaration
    public static readonly IntrinsicNamespace CheckedNamespace
    Field Value
    Type Description
    IntrinsicNamespace
    | Improve this Doc View Source

    UncheckedNamespace

    The namespace for unchecked arithmetic intrinsics.

    Declaration
    public static readonly IntrinsicNamespace UncheckedNamespace
    Field Value
    Type Description
    IntrinsicNamespace

    Methods

    | Improve this Doc View Source

    CreatePrototype(String, Boolean, IType, IType[])

    Creates an arithmetic intrinsic prototype.

    Declaration
    public static IntrinsicPrototype CreatePrototype(string operatorName, bool isChecked, IType resultType, params IType[] parameterTypes)
    Parameters
    Type Name Description
    System.String operatorName

    The name of the operator represented by the arithmetic intrinsic.

    System.Boolean isChecked

    Tells if the arithmetic intrinsic is checked, that is, if it throws on overflow.

    IType resultType

    The type of value produced by the intrinsic to create.

    IType[] parameterTypes

    The types of the values the intrinsic takes as arguments.

    Returns
    Type Description
    IntrinsicPrototype

    An arithmetic intrinsic prototype.

    | Improve this Doc View Source

    CreatePrototype(String, Boolean, IType, IReadOnlyList<IType>)

    Creates an arithmetic intrinsic prototype.

    Declaration
    public static IntrinsicPrototype CreatePrototype(string operatorName, bool isChecked, IType resultType, IReadOnlyList<IType> parameterTypes)
    Parameters
    Type Name Description
    System.String operatorName

    The name of the operator represented by the arithmetic intrinsic.

    System.Boolean isChecked

    Tells if the arithmetic intrinsic is checked, that is, if it throws on overflow.

    IType resultType

    The type of value produced by the intrinsic to create.

    System.Collections.Generic.IReadOnlyList<IType> parameterTypes

    The types of the values the intrinsic takes as arguments.

    Returns
    Type Description
    IntrinsicPrototype

    An arithmetic intrinsic prototype.

    | Improve this Doc View Source

    GetArithmeticIntrinsicName(String, Boolean)

    Creates an arithmetic intrinsic name from an arithmetic operator name.

    Declaration
    public static string GetArithmeticIntrinsicName(string operatorName, bool isChecked)
    Parameters
    Type Name Description
    System.String operatorName

    The operator name to wrap in an arithmetic intrinsic name.

    System.Boolean isChecked

    Tells if the arithmetic intrinsic is checked, that is, if it throws on overflow.

    Returns
    Type Description
    System.String

    An arithmetic intrinsic name.

    | Improve this Doc View Source

    IsArithmeticIntrinsicName(String)

    Tests if an intrinsic name is an arithmetic intrinsic name.

    Declaration
    public static bool IsArithmeticIntrinsicName(string intrinsicName)
    Parameters
    Type Name Description
    System.String intrinsicName

    The intrinsic name to examine.

    Returns
    Type Description
    System.Boolean

    true if the intrinsic name is an arithmetic intrinsic name; otherwise, false.

    | Improve this Doc View Source

    IsArithmeticIntrinsicPrototype(InstructionPrototype)

    Tests if an instruction prototype is a intrinsic prototype that corresponds to an arithmetic operation.

    Declaration
    public static bool IsArithmeticIntrinsicPrototype(InstructionPrototype prototype)
    Parameters
    Type Name Description
    InstructionPrototype prototype

    The prototype to examine.

    Returns
    Type Description
    System.Boolean

    true if the prototype is an arithmetic intrinsic prototype; otherwise, false.

    | Improve this Doc View Source

    ParseArithmeticIntrinsicName(String)

    Parses an intrinsic name as an arithmetic intrinsic name, assuming that the intrinsic name is an arithmetic intrinsic name. Returns the name of the operator wrapped by the arithmetic intrinsic name.

    Declaration
    public static string ParseArithmeticIntrinsicName(string intrinsicName)
    Parameters
    Type Name Description
    System.String intrinsicName

    The arithmetic intrinsic name to parse.

    Returns
    Type Description
    System.String

    The operator name wrapped by the arithmetic intrinsic name.

    | Improve this Doc View Source

    TryEvaluate(IntrinsicPrototype, IReadOnlyList<Constant>, out Constant)

    Tries to evaluate an application of a standard arithmetic operator.

    Declaration
    public static bool TryEvaluate(IntrinsicPrototype prototype, IReadOnlyList<Constant> arguments, out Constant result)
    Parameters
    Type Name Description
    IntrinsicPrototype prototype

    The full intrinsic prototype for the arithmetic operator.

    System.Collections.Generic.IReadOnlyList<Constant> arguments

    The operator application's arguments.

    Constant result

    The operator application's result, if it can be computed.

    Returns
    Type Description
    System.Boolean

    true if the operator application can be evaluated; otherwise, false.

    | Improve this Doc View Source

    TryParseArithmeticIntrinsicName(String, out String, out Boolean)

    Tries to parse an intrinsic name as an arithmetic intrinsic name.

    Declaration
    public static bool TryParseArithmeticIntrinsicName(string intrinsicName, out string operatorName, out bool isChecked)
    Parameters
    Type Name Description
    System.String intrinsicName

    The intrinsic name to parse.

    System.String operatorName

    The name of the operator specified by the intrinsic, if the intrinsic name is an arithmetic intrinsic name.

    System.Boolean isChecked

    Tells if the arithmetic intrinsic is checked, that is, if it throws on overflow.

    Returns
    Type Description
    System.Boolean

    true if the intrinsic name is an arithmetic intrinsic name; otherwise, false.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX