Pegasus Opcodes

The basic catagories

Opcodes for the operations fall into several basic catagories.
  • logical and arithmetic
These include all the operations you would normally thing would be in an IR. integer +,-,*,etc. Floating point +,-,*,etc. Logical operations, comparisons, etc.
  • Memory
These include load and store operations as well as operations which control the tokens that determine the order that memory operations can be invoked.
  • register type
These include operations which transfer data from the input to the output, potentially with some form of control. They generally are not in traditional IRs, but are here to help with optimizations such as pipelining.
  • Intra-hyperblock flow
These operations guide data flow within the hyperblock. It includes mux operations and hold operations
  • Inter-hyperblock flow
These operators guide data from one hyperblock to another (or potentially to the head of the current one if the current hyperblock is a loop.) Included here are mu, eta, and switch nodes.
  • Inter-Function flow
There include operations for calling a function, returning from a function, and related tasks, e.g., arguments, stack frames, etc.
  • Misc
There include miscellaneous operations
  • Epoch Related
The operations in this catagory are used to create and manage memory epochs and the memory operations that used epochs.
  • Other
Ignore these for now.

The operations

OpcodeInputsOutputsDotty textDotty Graphic 
 Description
add21+
  (Integer arithmetic) 
and21&
  (bitwise and logical ops) 
arg01 
  (Inter-Function flow)  This represents an incoming argument to the function. There is no input wire
asr21>>
  (bitwise and logical ops) 
cal-1-1call
  (Inter-Function flow)  In addition to the address (first arg) and the arguments to the callee (next n args for an n-arg call) there are four extra inputs SP, pred, token, crt.
(Old Simulator) 2 out: val,token; (New simulator) 4 out: val,SP,crt,token .
cast11(t)
  (misc)  This cases the input to the type of the ouput. May not be C casts, e.g., can cast a 16 bit signed into a 3 bit unsigned.
chk31chk
  (misc)  two address to check for equivalence, 3rd argument unique id
cmpl11~
  ( bitwise and logical ops) 
const01 
  (misc) The constant is represented as an immed in the node. It has no inputs.
cont-1-1cont
  (Inter-Function Flow)  call continuation: in: data, token. out: data, token (Old Simulator). call continuation: in: data, SP, crt, token out: data, SP, crt, token (New Simulator)
create12C
  ( misc)  1 in: crt, 2 out: address, token: allocate a symbol
delete21D
  ( misc)  in: address, token; out: token: destroy a symbol
div31/
  (Integer arithmetic)  3-rd input is a predicate. If false, don't perform the addition.
ecal-14Ecall
  ( Epoch based call infrastructure (works with the new simulator and lowered IR only))  4 out: val,SP,crt,epochId lowered: four extra in: SP, pred, epochId, crt
econt44Econt
  ( Epoch based call infrastructure (works with the new simulator and lowered IR only))  call continuation: in: data, SP, crt, epochId out: data, SP, crt, epochId
ecreate-13EC
  ( Epoch related)  epoch ids of epochs that have to complete before our epoch ops can execute second to last input: enabling token, cannot execute before getting this (?may not be needed?) last input: tree connection input outputs: 0 epoch-id, 1 completion token (?may not be needed?), 2 tree output
ehc-12EHC
  ( special epoch nodes for loops without calls)  epoch ids of epochs that have to complete before out epoch ops can execute second to last input: enabling token, cannot execute before getting this (?may not be needed?) last input: tree connection input outputs: 0 epoch-id, 1 tree output
elc22ELC
  ( special epoch nodes for loops without calls)  inputs: 0 epoch-id of prior chained epoch, 1 tree connection input outputs: 0 epoch-id, 1 tree connection output
eld32ELD
  (special epoch nodes for loops without calls)  inputs: 0 epoch-id of prior chained epoch, 1 predicate, 2 tree connection input outputs: 0 completion token (?may not be needed?), 1 tree output
elod42E=[ ]
  ( Epoch based memory operations)  inputs: address, predicate, epochid,treein; out = data,treeout
end00###Nada
  (misc) Never present.
epoch11E
  (Epoch related)  1 in: token 1 out: token to be sent to all epoch operations in parallel
eq21==
  (comparisons) 
eret40Eret
  ( Epoch based call infrastructure (works with the new simulator and lowered IR only))  inputs: returned value, PC, epochId, crt
estr41E[ ]=
  ( Epoch based memory operations)  inputs: address, data, predicate, epochid; out = treeout
eta31n
  (Inter-hyperblock flow)  3 in: val, pred, crt, 1 out: val. If pred is true and crt has arrived, then pass pass val to output.
fp_add21+
  ( FP stuff) 
fp_div31/
  ( FP stuff)  3-rd input is predicate
fp_mul21*
  ( FP stuff) 
fp_neg11-
  ( FP stuff) 
fp_sub21-
  ( FP stuff) 
frame12frm
  ( OBS: This applies to the old simulator only )  create a frame on the stack; in=token, out=sp, token
hold21H
  ( )  loop invariant op; in: data, predicate; out: data. If predicate is true, pass data to output.
land-11&&
  ( bitwise and logical ops)  logical and. Can take many inputs, all evaluated and anded together.
ldcont11=[+]
  ( memory ops)  inputs: data; out = data
le21<
  ( comparisons) 
leq21<=
  ( comparisons) 
lod32=[ ]
  ( memory ops)  inputs: address, predicate, token; out = data, token. if predicate is true, issue load when token arrives. Return data and when load performed, issue token.
lod_nopred51N=[ ]
  ( Hardware Ops for Memory)  inputs: address, token, global token path, local token path, value path; outputs: tree access
lod_pred52P=[ ]
  ( Hardware Ops for Memory)  inputs: address, token, global token path, local token path, value path; outputs: tree access, false token
lor-11||
  ( bitwise and logical ops)  logical or of multiple inputs.
lsl21<<
  ( bitwise and logical ops) 
lsq22LSQ
  ( Memory Tree)  tree reply
lsr21>>
  ( bitwise and logical ops) 
lvmerge21LVU
  ( Hardware Ops for Memory)  inputs: val, token; outputs: val
memap11MAP
  ( Memory Tree)  node representing the memory access port
memdemux1-1MD
  ( Memory Tree)  node to build tree from the memory access point to the circuits
memmux21MM
  ( Memory Tree)  node to build tree from circuits to the memory access point
memport11MPORT
  ( Memory Tree)  inputs: memory access; outputs: memory reply
memrvouz-1-1MRV
  ( Memory Tree)  girish's memory tree node
mu-12u
  ( control-flow)  loop entry point; 2nd out is hyper #, used by crt. This has n inputs, 1 of which will be valid. When it arrives, pass it onto the output. indicate which one arrived in the second output.
mul21*
  ( Integer arithmetic) 
muluh21muluh
  ( Integer arithmetic)  32x32->32 high bits of multiply
mux-11?:
  (Intra-hyperblock flow)  2n inputs. first n inputs are data, second n inputs are predicates. Only 1 predicate should eval to true, its data input is sent to the output.
ne21!=
  ( comparisons) 
neg11-
  ( Integer arithmetic) 
network-1-1NET
  ( network node)  used in simulator to model the network
none01???Nada
  (misc )  different from no-operation: temporary placeholder
nop11 
  (register type)  copy input to output: 0 clock cycles
not11!
  ( comparisons) 
or21|
  ( bitwise and logical ops) 
pop11pop
  ( OBS: This applies to the old simulator only )  pop a frame of the stack; in=token, out=token
reg11 
  (register type )  copy input to output: 1 clock cycle
rem31%
  ( Integer arithmetic)  3-rd in is predicate
ret40ret
  (Inter-Function flow)  inputs: returned value, PC, token, crt. return value to caller at PC when you get token and crt.
sp11sp
  ( OBS: This applies to the old simulator only )  get current SP value; in=token, out=SP
str41[ ]=
  ( memory ops)  inputs: address, data, predicate, token; out = token. if predicate is true, perform store of data into address. When store is performed, issue token.
str_nopred51N[ ]=
  ( Hardware Ops for Memory)  inputs: address, data, token, global token path, local token path; outputs: tree access
str_pred52P[ ]=
  ( Hardware Ops for Memory)  inputs: address, data, token, global token path, local token path; outputs: tree access, false token
sub21-
  ( Integer arithmetic) 
switch-11Y
  (Inter-hyperblock flow)  n inputs; last one is hyper number; 1 out: val The last input determines which one of the first n inputs is passed to the output.
tkand-11V
  ( tokens)  token and. And all the inputs to produce a token on the output.
tkgen21G
  ( tokens)  token generator: 2 in: token, predicate; 1 out token
tlod43T=[ ]
  ( Memory Tree load store ops)  inputs: address, predicate, token, treein; outputs: data, token, treeout
tokrelease12TKR
  ( Hardware Ops for Memory)  inputs: tree access; outputs: tree access, token
tstr52T[ ]=
  ( Memory Tree load store ops)  inputs: address, data, predicate, token, treein; outputs: token, treeout
uninit01???Nada
  (misc )  uninitialized value
xor21^
  ( bitwise and logical ops)