summaryrefslogtreecommitdiff
path: root/source/slang/ir.h
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-09-11 15:25:31 -0700
committerTim Foley <tfoley@nvidia.com>2017-09-11 15:27:08 -0700
commit4644b64d648893718336d83fae0139ee19405e61 (patch)
treef7c623dc814b823a535d38b68029f529af36780f /source/slang/ir.h
parente2de1eaec725e979f98ad6f518b93b4d9ce55a36 (diff)
Get another test working with IR codedgen
- Add support for matrix types in IR/codegen - Add support for basic indexing operations in IR/codegen
Diffstat (limited to 'source/slang/ir.h')
-rw-r--r--source/slang/ir.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/slang/ir.h b/source/slang/ir.h
index 1561d15a7..6e4a25fe1 100644
--- a/source/slang/ir.h
+++ b/source/slang/ir.h
@@ -275,6 +275,17 @@ struct IRVectorType : IRType
IRInst* getElementCount() { return elementCount.usedValue; }
};
+struct IRMatrixType : IRType
+{
+ IRUse elementType;
+ IRUse rowCount;
+ IRUse columnCount;
+
+ IRType* getElementType() { return (IRType*) elementType.usedValue; }
+ IRInst* getRowCount() { return rowCount.usedValue; }
+ IRInst* getColumnCount() { return columnCount.usedValue; }
+};
+
struct IRFuncType : IRType
{
IRUse resultType;
@@ -497,6 +508,10 @@ struct IRBuilder
IRType* getBaseType(BaseType flavor);
IRType* getBoolType();
IRType* getVectorType(IRType* elementType, IRValue* elementCount);
+ IRType* getMatrixType(
+ IRType* elementType,
+ IRValue* rowCount,
+ IRValue* columnCount);
IRType* getTypeType();
IRType* getVoidType();
IRType* getBlockType();
@@ -568,6 +583,17 @@ struct IRBuilder
IRValue* basePtr,
IRStructField* field);
+ IRInst* emitElementExtract(
+ IRType* type,
+ IRValue* base,
+ IRValue* index);
+
+ IRInst* emitElementAddress(
+ IRType* type,
+ IRValue* basePtr,
+ IRValue* index);
+
+
IRInst* emitReturn(
IRValue* val);