summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index 1a6187a92..13840a84a 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -2270,6 +2270,23 @@ namespace Slang
return (IRAnyValueType*)getType(kIROp_AnyValueType, size);
}
+ IRTupleType* IRBuilder::getTupleType(UInt count, IRType* const* types)
+ {
+ return (IRTupleType*)getType(kIROp_TupleType, count, (IRInst*const*)types);
+ }
+
+ IRTupleType* IRBuilder::getTupleType(IRType* type0, IRType* type1)
+ {
+ IRType* operands[] = { type0, type1 };
+ return getTupleType(2, operands);
+ }
+
+ IRTupleType* IRBuilder::getTupleType(IRType* type0, IRType* type1, IRType* type2)
+ {
+ IRType* operands[] = { type0, type1, type2 };
+ return getTupleType(3, operands);
+ }
+
IRBasicBlockType* IRBuilder::getBasicBlockType()
{
return (IRBasicBlockType*)getType(kIROp_BasicBlockType);
@@ -2721,6 +2738,17 @@ namespace Slang
return inst;
}
+ IRInst* IRBuilder::emitMakeTuple(IRType* type, UInt count, IRInst* const* args)
+ {
+ return emitIntrinsicInst(type, kIROp_MakeTuple, count, args);
+ }
+
+ IRInst* IRBuilder::emitGetTupleElement(IRType* type, IRInst* tuple, UInt element)
+ {
+ IRInst* args[] = { tuple, getIntValue(getIntType(), element) };
+ return emitIntrinsicInst(type, kIROp_GetTupleElement, 2, args);
+ }
+
IRInst* IRBuilder::emitMakeVector(
IRType* type,
UInt argCount,