Home My Page Projects Code Snippets Project Openings diderot
 Summary Activity Tracker Tasks SCM

# SCM Repository

[diderot] View of /trunk/src/compiler/IL/gen/mid-il.spec
 [diderot] / trunk / src / compiler / IL / gen / mid-il.spec

# View of /trunk/src/compiler/IL/gen/mid-il.spec

Mon Sep 20 02:47:00 2010 UTC (10 years, 10 months ago) by jhr
File size: 1927 byte(s)
```  Adding comments
```
```# specification of operators for MidIL version of the IR.  Each line (other than comments)
# specifies an operator using four fields, which are separated by ":".  The fields are
#	name
#	argument type		(optional)
#	arity
#	comment			(optional)
#
# type-indexed arithmetic operations
Add : ty : 2 :
Sub : ty : 2 :
Mul : ty : 2 :
Div : ty : 2 :
Neg : ty : 1 :
LT : ty : 2 :
LTE : ty : 2 :
EQ : ty : 2 :
NEQ : ty : 2 :
GT : ty : 2 :
GTE : ty : 2 :
Not : : 1 : boolean negation
Max : : 2 :
Min : : 2 :
Sin : : 1 :
Cos : : 1 :
Pow : : 2 :
#
### vector operations
# Dot<ty>(u, v)	-- computes dot product of u and v; ty specifies u and v's type
Dot : ty : 2 :
# Cross(u, v)	-- computes cross product of u and v
Cross : : 2 :
# Select<i>(u)  -- select ith element of vector u
Select : int : 1 :
# Norm<ty>(u)   -- computes length of vector u; ty specifies u's type
Norm : ty : 1 :
# Scale<ty>(s,u) -- multiply scalar s time vector u; ty specifies u's type
Scale : ty : 2 : scalar*vector multiplication
# IncScale<ty>(s,u) -- divide vector u by scalar s; ty specifies u's type
InvScale : ty : 2 : vector/scalar division
CL : : 1 : linear anisotropy measures
PrincipleEvec : ty : 2 : principle eigenvector; ty is result vector type
Subscript : ty : 2 :
Floor : int : 1 : compute real floor of a vector
#
### conversions
IntToReal : : 1 :
TruncToInt : int : 1 :
RoundToInt : int : 1 :
CeilToInt : int : 1 :
FloorToInt : int : 1 :
#
### image/kernel operations
VoxelAddress : ImageInfo.info : * : compute the address of a voxel
LoadVoxels : RawTypes.ty * int : 1 : load a vector of voxel values from an address
Transform : ImageInfo.info : 1 : transform a position to image-space
# EvalKernel<i,h,k>(u)
EvalKernel : int * Kernel.kernel * int : 1 : apply a kernel function to a scalar or vector of arguments