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

ShOperation.cpp

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 #include <iostream>
00028 #include "ShOperation.hpp"
00029 
00030 namespace SH {
00031 
00035 const ShOperationInfo opInfo[] = {
00036   {"ASN", 1, ShOperationInfo::LINEAR, false},
00037   
00038   {"NEG", 1, ShOperationInfo::LINEAR, false},
00039   {"ADD", 2, ShOperationInfo::LINEAR, true},
00040   {"MUL", 2, ShOperationInfo::LINEAR, true},
00041   {"DIV", 2, ShOperationInfo::LINEAR, false},
00042 
00043   {"SLT", 2, ShOperationInfo::LINEAR, false},
00044   {"SLE", 2, ShOperationInfo::LINEAR, false},
00045   {"SGT", 2, ShOperationInfo::LINEAR, false},
00046   {"SGE", 2, ShOperationInfo::LINEAR, false},
00047   {"SEQ", 2, ShOperationInfo::LINEAR, false},
00048   {"SNE", 2, ShOperationInfo::LINEAR, false},
00049   
00050   {"ABS", 1, ShOperationInfo::LINEAR, false},
00051   {"ACOS", 1, ShOperationInfo::LINEAR, false},
00052   {"ASIN", 1, ShOperationInfo::LINEAR, false},
00053   {"ATAN", 1, ShOperationInfo::LINEAR, false},
00054   {"ATAN2", 2, ShOperationInfo::LINEAR, false},
00055 
00056   {"CBRT", 1, ShOperationInfo::LINEAR, false},
00057   {"CEIL", 1, ShOperationInfo::LINEAR, false},
00058   {"COS", 1, ShOperationInfo::LINEAR, false},
00059   {"CMUL", 1, ShOperationInfo::ALL, false},
00060   {"CSUM", 1, ShOperationInfo::ALL, false},
00061   {"DOT", 2, ShOperationInfo::ALL, true},
00062   {"DX", 1, ShOperationInfo::EXTERNAL, false},
00063   {"DY", 1, ShOperationInfo::EXTERNAL, false},
00064 
00065   {"EXP", 1, ShOperationInfo::LINEAR, false},
00066   {"EXP2", 1, ShOperationInfo::LINEAR, false},
00067   {"EXP10", 1, ShOperationInfo::LINEAR, false},
00068   {"FLR", 1, ShOperationInfo::LINEAR, false},
00069   {"FRAC", 1, ShOperationInfo::LINEAR, false},
00070 
00071   {"LOG", 1, ShOperationInfo::LINEAR, false},
00072   {"LOG2", 1, ShOperationInfo::LINEAR, false},
00073   {"LOG10", 1, ShOperationInfo::LINEAR, false},
00074   {"LRP", 3, ShOperationInfo::LINEAR, false},
00075 
00076   {"MAD", 3, ShOperationInfo::LINEAR, false},
00077   {"MAX", 2, ShOperationInfo::LINEAR, false},
00078   {"MIN", 2, ShOperationInfo::LINEAR, true},
00079   {"MOD", 2, ShOperationInfo::LINEAR, true},
00080 
00081   {"POW", 2, ShOperationInfo::LINEAR, false},
00082   {"RCP", 1, ShOperationInfo::LINEAR, false},
00083   {"RND", 1, ShOperationInfo::LINEAR, false},
00084   {"RSQ", 1, ShOperationInfo::LINEAR, false},
00085 
00086   {"SIN", 1, ShOperationInfo::LINEAR, false},
00087   {"SGN", 1, ShOperationInfo::LINEAR, false},
00088   {"SQRT", 1, ShOperationInfo::LINEAR, false},
00089   {"TAN", 1, ShOperationInfo::LINEAR, false},
00090 
00091   {"NORM", 1, ShOperationInfo::ALL, false},
00092   {"XPD", 2, ShOperationInfo::ALL, false}, // Not quite true, but probably good enough
00093 
00094   {"TEX", 2, ShOperationInfo::EXTERNAL, false},
00095   {"TEXI", 2, ShOperationInfo::EXTERNAL, false},
00096   {"TEXD", 3, ShOperationInfo::EXTERNAL, false},
00097 
00098   {"COND", 3, ShOperationInfo::LINEAR, false},
00099 
00100   {"KIL", 1, ShOperationInfo::IGNORE, false},
00101 
00102   {"OPTBRA", 1, ShOperationInfo::IGNORE, false},
00103 
00104   {"FETCH", 1, ShOperationInfo::EXTERNAL, false},
00105   {"LOOKUP", 2, ShOperationInfo::EXTERNAL, false},
00106 
00107   {"PAL", 2, ShOperationInfo::EXTERNAL, false},
00108 
00109   {"LO", 1, ShOperationInfo::LINEAR, false},
00110   {"HI", 1, ShOperationInfo::LINEAR, false},
00111   {"SETLO", 1, ShOperationInfo::LINEAR, false},
00112   {"SETHI", 1, ShOperationInfo::LINEAR, false},
00113   
00114   {0, 0, ShOperationInfo::IGNORE, false}
00115 };
00116 
00117 
00118 } // namespace SH
00119 

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