2.1 IR Instruction Set

Insn::= move(Src,Dest)
| cmove(Cond,Src,Dest)
| cmps(Dest,Src)
| cmpu(Dest,Src)
| test(Dest,Src)
| jump(Target)
| call(Target)
| ccall(Cond,Target)
| branch(Cond,Target)
| add(Src,Src,Dest)
| addo(Src,Src,Dest)
| sub(Src,Src,Dest)
| subo(Src,Src,Dest)
| mulo(Src,Src,Dest)
| sh(Src,Src,Dest)
| and(Src,Src,Dest)
| or(Src,Src,Dest)
| xor(Src,Src,Dest)
| int2cp(Src,Dest)
| cp2int(Src,Dest)
| init(Dest,Dest)
| pop
| context(Target)
| half(Constant)
| word(Constant)
| label(_)
| align(0 | 1 | 2 | 3 | 4)
| try_chain(list of (label(_)-Int),Int)
| switch(list of (Immediate-Target),Target)
 
Cond::= gu | geu | lu | leu | g | ge | l | le | e | ne | no | o
 
Target::= kernel(Atom)
| label(_)
| native_entry(Atom:Atom/Int)
| native_entry(Int)
| cp(Offset)
| Int
 
Src::= Immediate | Reg | Mem
 
Dest::= Reg | Mem
 
Immediate::= functor(Atom/Int)
| constant(Atomic)
| nil
| label(Cont)
| Offset
 
Reg::= val | h | s | ac0 | ac1 | ab | a | e | cp | b
| gpr(Int) // general purpose register
| fpr(Int) // floating-point register
| arg0
| arg1
| arg2
| w_insn
| w_heap_warn_soft
| w_next_node
| w_numstack_end
| w_stack_start
| w_stack_warn
| w_fli_stack_start
 
Mem::= x(Int) | x(Int,_) | y(Int) | y(Int,_)
| a(Offset)
| e(Offset)
| cp(Offset)
| h(Offset)
| s(Offset)
| val(Offset)
 
Offset::= half(Constant)
| word(Constant)
| Constant
 
Constant::= native_op
| kontinue
| itoy(Int)
| Int
| native_entry(Atom:Atom/Int)
| native_entry(Int)


Send feedback on this subject.