GPUOcelot
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

ir::PTXOperand Class Reference

#include <PTXOperand.h>

List of all members.

Public Types

enum  AddressMode {
  Register, Indirect, Immediate, Address,
  Label, Special, ArgumentList, FunctionName,
  BitBucket, Invalid
}
 

addressing mode of operand

More...
enum  DataType {
  s8 = 0, s16, s32, s64,
  u8 = 4, u16, u32, u64,
  f16 = 8, f32, f64, b8,
  b16, b32, b64, pred,
  TypeSpecifier_invalid
}
enum  SpecialRegister {
  tid, ntid, laneId, warpId,
  nwarpId, warpSize, ctaId, nctaId,
  smId, nsmId, gridId, clock,
  clock64, lanemask_eq, lanemask_le, lanemask_lt,
  lanemask_ge, lanemask_gt, pm0, pm1,
  pm2, pm3, envreg0, envreg1,
  envreg2, envreg3, envreg4, envreg5,
  envreg6, envreg7, envreg8, envreg9,
  envreg10, envreg11, envreg12, envreg13,
  envreg14, envreg15, envreg16, envreg17,
  envreg18, envreg19, envreg20, envreg21,
  envreg22, envreg23, envreg24, envreg25,
  envreg26, envreg27, envreg28, envreg29,
  envreg30, envreg31, SpecialRegister_invalid
}
enum  PredicateCondition { Pred, InvPred, PT, nPT }
enum  Vec { v1 = 1, v2 = 2, v4 = 4 }
enum  VectorIndex {
  iAll = 0, ix = 1, iy = 2, iz = 3,
  iw = 4
}
typedef std::vector< PTXOperandArray
typedef Instruction::RegisterType RegisterType

Public Member Functions

 PTXOperand ()
 PTXOperand (SpecialRegister r, VectorIndex i=iAll, DataType t=u32)
 PTXOperand (const std::string &label)
 PTXOperand (AddressMode m, DataType t, RegisterType r=0, int o=0, Vec v=v1)
 PTXOperand (AddressMode m, DataType t, const std::string &identifier, int o=0, Vec v=v1)
 PTXOperand (AddressMode m, const std::string &identifier)
 PTXOperand (long long unsigned int v, DataType t=u64)
 ~PTXOperand ()
std::string toString () const
std::string registerName () const
unsigned int bytes () const
bool isRegister () const

Static Public Member Functions

static std::string toString (VectorIndex)
static std::string toString (DataType)
static std::string toString (SpecialRegister)
static std::string toString (AddressMode)
static std::string toString (DataType, RegisterType)
static bool isFloat (DataType)
static bool isInt (DataType)
static bool isSigned (DataType)
static unsigned int bytes (DataType)
static bool valid (DataType, DataType)
static bool relaxedValid (DataType instructionType, DataType)
static long long unsigned int maxInt (DataType type)
static long long unsigned int minInt (DataType type)

Public Attributes

std::string identifier
 identifier of operand
AddressMode addressMode
 addressing mode of operand
DataType type
 data type for PTX instruction
union {
   int   offset
   VectorIndex   vIndex
   unsigned int   registerCount
}; 
union {
   long long unsigned int   imm_uint
   long long int   imm_int
   double   imm_float
   PredicateCondition   condition
   SpecialRegister   special
   unsigned int   localMemorySize
}; 
union {
   RegisterType   reg
   bool   isArgument
   bool   isGlobalLocal
   unsigned int   sharedMemorySize
}; 
union {
   Vec   vec
 Indicates whether target or source is a vector or scalar.
   unsigned int   stackMemorySize
}; 
Array array
 Array if this is a vector.

Member Typedef Documentation

typedef std::vector<PTXOperand> ir::PTXOperand::Array

Member Enumeration Documentation

addressing mode of operand

Enumerator:
Register 
Indirect 

use as register variable

Immediate 

indirect access

Address 

treat as immediate value

Label 

treat as addressable variable

Special 

operand is a label

ArgumentList 

special register

FunctionName 

treat as argument list for function call

BitBucket 

operand is a function name

Invalid 

bit bucket register

Type specifiers for instructions

Enumerator:
s8 
s16 
s32 
s64 
u8 
u16 
u32 
u64 
f16 
f32 
f64 
b8 
b16 
b32 
b64 
pred 
TypeSpecifier_invalid 
Enumerator:
Pred 
InvPred 
PT 
nPT 

Special register names

Enumerator:
tid 
ntid 
laneId 
warpId 
nwarpId 
warpSize 
ctaId 
nctaId 
smId 
nsmId 
gridId 
clock 
clock64 
lanemask_eq 
lanemask_le 
lanemask_lt 
lanemask_ge 
lanemask_gt 
pm0 
pm1 
pm2 
pm3 
envreg0 
envreg1 
envreg2 
envreg3 
envreg4 
envreg5 
envreg6 
envreg7 
envreg8 
envreg9 
envreg10 
envreg11 
envreg12 
envreg13 
envreg14 
envreg15 
envreg16 
envreg17 
envreg18 
envreg19 
envreg20 
envreg21 
envreg22 
envreg23 
envreg24 
envreg25 
envreg26 
envreg27 
envreg28 
envreg29 
envreg30 
envreg31 
SpecialRegister_invalid 
Enumerator:
v1 
v2 
v4 
Enumerator:
iAll 
ix 

Refers to the complete vector.

iy 

Only refers to the x index of the vector.

iz 

Only refers to the y index of the vector.

iw 

Only refers to the z index of the vector.


Constructor & Destructor Documentation

ir::PTXOperand::PTXOperand ( )
ir::PTXOperand::PTXOperand ( SpecialRegister  r,
VectorIndex  i = iAll,
DataType  t = u32 
)
ir::PTXOperand::PTXOperand ( const std::string &  label)
ir::PTXOperand::PTXOperand ( AddressMode  m,
DataType  t,
RegisterType  r = 0,
int  o = 0,
Vec  v = v1 
)
ir::PTXOperand::PTXOperand ( AddressMode  m,
DataType  t,
const std::string &  identifier,
int  o = 0,
Vec  v = v1 
)
ir::PTXOperand::PTXOperand ( AddressMode  m,
const std::string &  identifier 
)
ir::PTXOperand::PTXOperand ( long long unsigned int  v,
DataType  t = u64 
)
ir::PTXOperand::~PTXOperand ( )

Member Function Documentation

unsigned int ir::PTXOperand::bytes ( DataType  type) [static]
unsigned int ir::PTXOperand::bytes ( ) const
bool ir::PTXOperand::isFloat ( DataType  type) [static]
bool ir::PTXOperand::isInt ( DataType  type) [static]
bool ir::PTXOperand::isRegister ( ) const
bool ir::PTXOperand::isSigned ( DataType  type) [static]
static long long unsigned int ir::PTXOperand::maxInt ( DataType  type) [static]
static long long unsigned int ir::PTXOperand::minInt ( DataType  type) [static]
std::string ir::PTXOperand::registerName ( ) const
bool ir::PTXOperand::relaxedValid ( DataType  instructionType,
DataType  operand 
) [static]
std::string ir::PTXOperand::toString ( AddressMode  mode) [static]
std::string ir::PTXOperand::toString ( DataType  type,
RegisterType  reg 
) [static]
std::string ir::PTXOperand::toString ( DataType  type) [static]
std::string ir::PTXOperand::toString ( VectorIndex  index) [static]
std::string ir::PTXOperand::toString ( ) const
std::string ir::PTXOperand::toString ( SpecialRegister  reg) [static]
bool ir::PTXOperand::valid ( DataType  destination,
DataType  source 
) [static]

Member Data Documentation

union { ... }
union { ... }
union { ... }
union { ... }

addressing mode of operand

Array if this is a vector.

identifier of operand

long long int ir::PTXOperand::imm_int
long long unsigned int ir::PTXOperand::imm_uint

Identifier for register

data type for PTX instruction

Indicates whether target or source is a vector or scalar.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines