From 019f702e24d2d1d6ecf53d71f87776a83db96608 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 29 Aug 2023 16:43:25 -0700 Subject: Wave intrinsics. (#3164) * Wave intrinsics. * scalar intrinsics. --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index cd49c6df5..d3cfea6e9 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -5747,6 +5747,31 @@ namespace Slang return i; } + IRSPIRVAsmOperand* IRBuilder::emitSPIRVAsmOperandBuiltinVar(IRInst* type, IRInst* builtinKind) + { + SLANG_ASSERT(as(m_insertLoc.getParent())); + const auto i = createInst( + this, + kIROp_SPIRVAsmOperandBuiltinVar, + (IRType*)type, + builtinKind + ); + addInst(i); + return i; + } + + IRSPIRVAsmOperand* IRBuilder::emitSPIRVAsmOperandGLSL450Set() + { + SLANG_ASSERT(as(m_insertLoc.getParent())); + const auto i = createInst( + this, + kIROp_SPIRVAsmOperandGLSL450Set, + getVoidType() + ); + addInst(i); + return i; + } + IRSPIRVAsmInst* IRBuilder::emitSPIRVAsmInst(IRInst* opcode, List operands) { SLANG_ASSERT(as(m_insertLoc.getParent())); @@ -7482,6 +7507,9 @@ namespace Slang if(as(this)) return false; + if (as(this)) + return false; + switch(getOp()) { // By default, assume that we might have side effects, -- cgit v1.2.3