ILGPU  0.9.0
ILGPU.IR.Values.PrimitiveValue Class Reference

Represents a primitive value. More...

Inheritance diagram for ILGPU.IR.Values.PrimitiveValue:
ILGPU.IR.Values.ConstantNode ILGPU.IR.Value ILGPU.IR.Node ILGPU.IR.IValue ILGPU.IR.INode ILGPU.IR.INode ILGPU.IR.ILocation ILGPU.IR.IDumpable ILGPU.IR.ILocation ILGPU.IR.IDumpable

Public Member Functions

override void Accept< T > (T visitor)
 
string ToValueString ()
 Returns the encapsulated value as string. More...
 
- Public Member Functions inherited from ILGPU.IR.Value
Use GetFirstUse ()
 Resolves the first use. More...
 
Value GetFirstUseNode ()
 Resolves the first use as value. More...
 
void Replace (Value other)
 Replaces this value with the given value. More...
 
Value Resolve ()
 Resolves the actual value with respect to replacement information. More...
 
ResolveAs< T > ()
 Resolves the actual value with respect to replacement information. More...
 
bool Equals (Value other)
 Returns true if the given value is the same value. More...
 
ReadOnlySpan< ValueReference >.Enumerator GetEnumerator ()
 Returns an enumerator to enumerate all child values. More...
 
sealed override string ToString ()
 Returns the string representation of this node. More...
 
override bool Equals (object obj)
 Returns true if the given object is equal to the current value. More...
 
override int GetHashCode ()
 Returns the hash code of this value. More...
 
- Public Member Functions inherited from ILGPU.IR.Node
virtual string FormatErrorMessage (string message)
 Formats an error message to include specific exception information. More...
 
virtual void Dump (TextWriter textWriter)
 Dumps this method to the given text writer. More...
 
string ToReferenceString ()
 Returns the string representation of this node as reference. More...
 
override string ToString ()
 Returns the string representation of this node. More...
 

Public Attributes

override ValueKind ValueKind => ValueKind.Primitive
 
PrimitiveType PrimitiveType => Type as PrimitiveType
 Returns the associated primitive type. More...
 
bool Int1Value => rawValue == 0 ? false : true
 Returns the value as i1. More...
 
sbyte Int8Value => (sbyte)(rawValue & 0xff)
 Returns the value as si8. More...
 
short Int16Value => (short)(rawValue & 0xffff)
 Returns the value as si16. More...
 
int Int32Value => (int)(rawValue & 0xffffffff)
 Returns the value as si32. More...
 
long Int64Value => rawValue
 Returns the value as si64. More...
 
byte UInt8Value => (byte)Int8Value
 Returns the value as u8. More...
 
ushort UInt16Value => (ushort)Int16Value
 Returns the value as u16. More...
 
uint UInt32Value => (uint)Int32Value
 Returns the value as u32. More...
 
ulong UInt64Value => (ulong)Int64Value
 Returns the value as u64. More...
 
Half Float16Value => Unsafe.As<long
 Returns the value as f16. More...
 
float Float32Value => Unsafe.As<long
 Returns the value as f32. More...
 
double Float64Value => Unsafe.As<long
 Returns the value as f64. More...
 
bool IsInt => BasicValueType.IsInt()
 Returns true if the value is an integer. More...
 
bool IsFloat => BasicValueType.IsFloat()
 Returns true if the value is a float. More...
 
long RawValue => rawValue
 Returns the underlying raw value. More...
 
- Public Attributes inherited from ILGPU.IR.Value
const ValueFlags DefaultFlags = ValueFlags.None
 The default value flags. More...
 
Method Method
 Returns the parent method. More...
 
BasicValueType BasicValueType
 Returns the associated basic value type. More...
 
bool CanBeReplaced
 Returns true if the current value can be replaced. More...
 
bool CanHaveUses
 Returns true if the current value can have uses. More...
 
bool HasStaticType
 Returns true if the current value has a static type. More...
 
bool IsSealed
 Returns true if the current value has been sealed. More...
 
bool IsReplaced => CanBeReplaced & Replacement != this
 Returns true if the current value has been replaced. More...
 
ReadOnlySpan< ValueReferenceNodes => values
 Returns all child values. More...
 
int Count => values.Count
 Returns the number of child values. More...
 
int AllNumUses => uses.Count
 Returns the total number of all associated uses. More...
 
UseCollection Uses => new UseCollection(this, uses)
 Returns all current uses (to non-replaced values). More...
 
ValueReference this[int index] => Nodes[index]
 Accesses the child value with the given index. More...
 

Protected Member Functions

override string ToPrefixString ()
 
override string ToArgString ()
 
- Protected Member Functions inherited from ILGPU.IR.Value
 Value (in ValueInitializer initializer)
 Constructs a new value that is marked as replaceable. More...
 
 Value (in ValueInitializer initializer, TypeNode staticType)
 Constructs a new value that is marked as replaceable. More...
 
 Value (in ValueInitializer initializer, ValueFlags valueFlags)
 Constructs a new value that is marked as replaceable. More...
 
 Value (in ValueInitializer initializer, ValueFlags valueFlags, TypeNode staticType)
 Constructs a new value that is marked as replaceable. More...
 
void InvalidateType ()
 Invalidates the current type and enforces a re-computation of the current type. More...
 
virtual TypeNode ComputeType (in ValueInitializer initializer)
 Computes the current type. More...
 
void VerifyNotSealed ()
 Verifies that the this value is not sealed. More...
 
void Seal ()
 Seals this value. More...
 
void Seal (ValueReference value1)
 Seals this value. More...
 
void Seal (ValueReference value1, ValueReference value2)
 Seals this value. More...
 
void Seal (ValueReference value1, ValueReference value2, ValueReference value3)
 Seals this value. More...
 
void Seal (ref ValueList valueList)
 Seals this value. More...
 
- Protected Member Functions inherited from ILGPU.IR.Node
 Node (Location location)
 Constructs a new node that is marked as replaceable. More...
 
void InferLocation< T > (ReadOnlySpan< T > elements)
 Infers the location (if required) of the current node. More...
 

Properties

new BasicValueType BasicValueType [get]
 Returns the associated basic type. More...
 
- Properties inherited from ILGPU.IR.Value
abstract ValueKind ValueKind [get]
 Returns the current value kind. More...
 
BasicBlock BasicBlock [get, set]
 Returns the parent basic block. More...
 
TypeNode Type [get]
 Returns the associated type. More...
 
ValueFlags ValueFlags [get]
 Returns the associated value flags. More...
 
Value Replacement [get]
 Returns the replacement of this value (if any). More...
 
- Properties inherited from ILGPU.IR.Node
Location Location [get]
 Returns the associated location. More...
 
NodeId Id [get]
 Returns the unique node id. More...
 
- Properties inherited from ILGPU.IR.INode
NodeId Id [get]
 Returns the unique node id. More...
 
Location Location [get]
 Returns the associated location. More...
 
- Properties inherited from ILGPU.IR.IValue
ValueKind ValueKind [get]
 Returns the current value kind. More...
 
TypeNode Type [get]
 Returns the associated type information. More...
 
BasicBlock BasicBlock [get]
 Returns the parent basic block. More...
 
BasicValueType BasicValueType [get]
 Returns the associated basic value type. More...
 
ReadOnlySpan< ValueReferenceNodes [get]
 Returns all associated nodes. More...
 
UseCollection Uses [get]
 Returns all associated uses. More...
 

Detailed Description

Represents a primitive value.

Member Function Documentation

override void ILGPU.IR.Values.PrimitiveValue.Accept< T > ( visitor)
virtual

Implements ILGPU.IR.Value.

override string ILGPU.IR.Values.PrimitiveValue.ToArgString ( )
protectedvirtual

Reimplemented from ILGPU.IR.Value.

override string ILGPU.IR.Values.PrimitiveValue.ToPrefixString ( )
protectedvirtual

Implements ILGPU.IR.Node.

string ILGPU.IR.Values.PrimitiveValue.ToValueString ( )

Returns the encapsulated value as string.

Returns
The string representation of the encapsulated value.

Member Data Documentation

Half ILGPU.IR.Values.PrimitiveValue.Float16Value => Unsafe.As<long

Returns the value as f16.

float ILGPU.IR.Values.PrimitiveValue.Float32Value => Unsafe.As<long

Returns the value as f32.

double ILGPU.IR.Values.PrimitiveValue.Float64Value => Unsafe.As<long

Returns the value as f64.

short ILGPU.IR.Values.PrimitiveValue.Int16Value => (short)(rawValue & 0xffff)

Returns the value as si16.

bool ILGPU.IR.Values.PrimitiveValue.Int1Value => rawValue == 0 ? false : true

Returns the value as i1.

int ILGPU.IR.Values.PrimitiveValue.Int32Value => (int)(rawValue & 0xffffffff)

Returns the value as si32.

long ILGPU.IR.Values.PrimitiveValue.Int64Value => rawValue

Returns the value as si64.

sbyte ILGPU.IR.Values.PrimitiveValue.Int8Value => (sbyte)(rawValue & 0xff)

Returns the value as si8.

bool ILGPU.IR.Values.PrimitiveValue.IsFloat => BasicValueType.IsFloat()

Returns true if the value is a float.

bool ILGPU.IR.Values.PrimitiveValue.IsInt => BasicValueType.IsInt()

Returns true if the value is an integer.

PrimitiveType ILGPU.IR.Values.PrimitiveValue.PrimitiveType => Type as PrimitiveType

Returns the associated primitive type.

long ILGPU.IR.Values.PrimitiveValue.RawValue => rawValue

Returns the underlying raw value.

ushort ILGPU.IR.Values.PrimitiveValue.UInt16Value => (ushort)Int16Value

Returns the value as u16.

uint ILGPU.IR.Values.PrimitiveValue.UInt32Value => (uint)Int32Value

Returns the value as u32.

ulong ILGPU.IR.Values.PrimitiveValue.UInt64Value => (ulong)Int64Value

Returns the value as u64.

byte ILGPU.IR.Values.PrimitiveValue.UInt8Value => (byte)Int8Value

Returns the value as u8.

override ValueKind ILGPU.IR.Values.PrimitiveValue.ValueKind => ValueKind.Primitive

Property Documentation

new BasicValueType ILGPU.IR.Values.PrimitiveValue.BasicValueType
get

Returns the associated basic type.


The documentation for this class was generated from the following file: