summaryrefslogtreecommitdiff
path: root/source/slang/intrinsic-defs.h
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-09 11:34:21 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-09 13:44:59 -0700
commitfcf83dbf9effab3bd98bad2b83b2468b7eb05cfd (patch)
tree41047c94883b86ec085a81597391ce3ef557cd43 /source/slang/intrinsic-defs.h
parent52e8d4b9a27ab0060f874c3a63ab531847be35c0 (diff)
Initial import of code.
Diffstat (limited to 'source/slang/intrinsic-defs.h')
-rw-r--r--source/slang/intrinsic-defs.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/source/slang/intrinsic-defs.h b/source/slang/intrinsic-defs.h
new file mode 100644
index 000000000..19a3899a3
--- /dev/null
+++ b/source/slang/intrinsic-defs.h
@@ -0,0 +1,94 @@
+// intrinsic-defs.h
+
+// The file is meant to be included multiple times, to produce different
+// pieces of code related to intrinsic operations
+//
+// Each intrinsic op is declared here with:
+//
+// INTRINSIC(name)
+//
+
+#ifndef INTRINSIC
+#error Need to define INTRINSIC(NAME) before including "intrinsic-defs.h"
+#endif
+
+INTRINSIC(Add)
+INTRINSIC(Sub)
+INTRINSIC(Mul)
+INTRINSIC(Div)
+INTRINSIC(Mod)
+
+INTRINSIC(Lsh)
+INTRINSIC(Rsh)
+
+INTRINSIC(Eql)
+INTRINSIC(Neq)
+INTRINSIC(Greater)
+INTRINSIC(Less)
+INTRINSIC(Geq)
+INTRINSIC(Leq)
+INTRINSIC(BitAnd)
+INTRINSIC(BitXor)
+INTRINSIC(BitOr)
+
+// TODO(tfoley): need to distinguish short-circuiting and not...
+INTRINSIC(And)
+INTRINSIC(Or)
+
+INTRINSIC(Assign)
+INTRINSIC(AddAssign)
+INTRINSIC(SubAssign)
+INTRINSIC(MulAssign)
+INTRINSIC(DivAssign)
+INTRINSIC(ModAssign)
+INTRINSIC(LshAssign)
+INTRINSIC(RshAssign)
+INTRINSIC(OrAssign)
+INTRINSIC(AndAssign)
+INTRINSIC(XorAssign)
+INTRINSIC(Neg)
+INTRINSIC(Not)
+INTRINSIC(BitNot)
+INTRINSIC(PreInc)
+INTRINSIC(PreDec)
+INTRINSIC(PostInc)
+INTRINSIC(PostDec)
+
+INTRINSIC(Sequence)
+INTRINSIC(Select)
+
+INTRINSIC(Mul_Scalar_Scalar)
+INTRINSIC(Mul_Vector_Scalar)
+INTRINSIC(Mul_Scalar_Vector)
+INTRINSIC(Mul_Matrix_Scalar)
+INTRINSIC(Mul_Scalar_Matrix)
+INTRINSIC(InnerProduct_Vector_Vector)
+INTRINSIC(InnerProduct_Vector_Matrix)
+INTRINSIC(InnerProduct_Matrix_Vector)
+INTRINSIC(InnerProduct_Matrix_Matrix)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// Un-deefine the macor here, so that the client does not have to.
+#undef INTRINSIC