Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShOperation.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory
00004 // Project administrator: Michael D. McCool
00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa,
00006 //          Michael D. McCool
00007 // 
00008 // This software is provided 'as-is', without any express or implied
00009 // warranty. In no event will the authors be held liable for any damages
00010 // arising from the use of this software.
00011 // 
00012 // Permission is granted to anyone to use this software for any purpose,
00013 // including commercial applications, and to alter it and redistribute it
00014 // freely, subject to the following restrictions:
00015 // 
00016 // 1. The origin of this software must not be misrepresented; you must
00017 // not claim that you wrote the original software. If you use this
00018 // software in a product, an acknowledgment in the product documentation
00019 // would be appreciated but is not required.
00020 // 
00021 // 2. Altered source versions must be plainly marked as such, and must
00022 // not be misrepresented as being the original software.
00023 // 
00024 // 3. This notice may not be removed or altered from any source
00025 // distribution.
00027 #ifndef SHOPERATION_HPP
00028 #define SHOPERATION_HPP
00029 
00030 #include "ShDllExport.hpp"
00031 
00032 namespace SH {
00033 
00039 enum ShOperation {
00040   SH_OP_ASN, 
00041 
00042   // Simple arithmetic
00043   SH_OP_NEG, 
00044   SH_OP_ADD, 
00045   SH_OP_MUL, 
00046 
00047   SH_OP_DIV, 
00048 
00049   // Comparisons
00050   // All of the following set dst to either 1 or 0.
00051   SH_OP_SLT, 
00052   SH_OP_SLE, 
00053   SH_OP_SGT, 
00054   SH_OP_SGE, 
00055   SH_OP_SEQ, 
00056   SH_OP_SNE, 
00057 
00058   // The bulk
00059   SH_OP_ABS, 
00060   SH_OP_ACOS, 
00061   SH_OP_ASIN, 
00062   SH_OP_ATAN, 
00063   SH_OP_ATAN2, 
00064 
00065   SH_OP_CBRT, 
00066   SH_OP_CEIL, 
00067   SH_OP_COS, 
00068   SH_OP_CMUL, 
00069   SH_OP_CSUM, 
00070   SH_OP_DOT, 
00071   SH_OP_DX, 
00072   SH_OP_DY, 
00073 
00074   SH_OP_EXP, 
00075   SH_OP_EXP2, 
00076   SH_OP_EXP10, 
00077   SH_OP_FLR, 
00078   SH_OP_FRAC, 
00079 
00080   SH_OP_LOG, 
00081   SH_OP_LOG2, 
00082   SH_OP_LOG10, 
00083   SH_OP_LRP, 
00084 
00085   SH_OP_MAD, 
00086   SH_OP_MAX, 
00087   SH_OP_MIN, 
00088   SH_OP_MOD, 
00089 
00090   SH_OP_POW, 
00091   SH_OP_RCP, 
00092   SH_OP_RND, 
00093   SH_OP_RSQ, 
00094 
00095   SH_OP_SIN, 
00096   SH_OP_SGN, 
00097   SH_OP_SQRT, 
00098   SH_OP_TAN, 
00099 
00100   // "Vector" operations
00101   SH_OP_NORM, 
00102   SH_OP_XPD, 
00103 
00104   // Textures
00105   SH_OP_TEX, 
00106   SH_OP_TEXI, 
00107   SH_OP_TEXD, 
00108 
00109   // Conditionals
00110   SH_OP_COND, 
00111 
00112   // Fragment kill
00113   SH_OP_KIL, 
00114 
00115   // Special
00116   SH_OP_OPTBRA, 
00117 
00118 
00119 
00120   // Streams
00121   SH_OP_FETCH, 
00122   SH_OP_LOOKUP, 
00123 
00124 
00125   // Palettes
00126   SH_OP_PAL, 
00127 
00128   SH_OP_LO,  
00129   SH_OP_HI,  
00130   SH_OP_SETLO, 
00131   SH_OP_SETHI, 
00132 
00133   SH_OPERATION_END, 
00134 };
00135 
00136 #ifdef IGNORE
00137 #undef IGNORE
00138 #endif
00139 
00141 struct
00142 SH_DLLEXPORT
00143 ShOperationInfo {
00144   const char* name; 
00145   int arity; 
00146 
00147   enum ResultSource {
00148     LINEAR,   // dest[i] depends only on src_j[i] for all 0 <= j < arity
00149     ALL,      // dest[i] depends on all elements of src_j for all 0 <= j < arity
00150     EXTERNAL, // Statement yields its results from an external source
00151               // (e.g. TEX)
00152     IGNORE   // Does not yield a result
00153   } result_source;
00154 
00155   bool commutative; 
00156 };
00157 
00158 
00159 SH_DLLEXPORT
00160 extern const ShOperationInfo opInfo[];
00161 
00162 } // namespace SH
00163 
00164 #endif

Generated on Mon Jan 24 18:36:34 2005 for Sh by  doxygen 1.4.1