Commit e37ce613 by Ben Clayton

SpirvShader: Implement OpBranch

Bug: b/128527271 Change-Id: I367ed0d578e36a56baf4b8c4c2256ee4de1297cc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27097 Presubmit-Ready: Ben Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 644a350a
...@@ -1185,6 +1185,10 @@ namespace sw ...@@ -1185,6 +1185,10 @@ namespace sw
EmitAll(insn, routine); EmitAll(insn, routine);
break; break;
case spv::OpBranch:
EmitBranch(insn, routine);
break;
default: default:
UNIMPLEMENTED(OpcodeName(insn.opcode()).c_str()); UNIMPLEMENTED(OpcodeName(insn.opcode()).c_str());
break; break;
...@@ -2148,6 +2152,12 @@ namespace sw ...@@ -2148,6 +2152,12 @@ namespace sw
dst.emplace(0, result); dst.emplace(0, result);
} }
void SpirvShader::EmitBranch(InsnIterator insn, SpirvRoutine *routine) const
{
auto blockId = Block::ID(insn.word(1));
EmitBlock(routine, getBlock(blockId));
}
void SpirvShader::emitEpilog(SpirvRoutine *routine) const void SpirvShader::emitEpilog(SpirvRoutine *routine) const
{ {
for (auto insn : *this) for (auto insn : *this)
......
...@@ -490,6 +490,7 @@ namespace sw ...@@ -490,6 +490,7 @@ namespace sw
void EmitExtendedInstruction(InsnIterator insn, SpirvRoutine *routine) const; void EmitExtendedInstruction(InsnIterator insn, SpirvRoutine *routine) const;
void EmitAny(InsnIterator insn, SpirvRoutine *routine) const; void EmitAny(InsnIterator insn, SpirvRoutine *routine) const;
void EmitAll(InsnIterator insn, SpirvRoutine *routine) const; void EmitAll(InsnIterator insn, SpirvRoutine *routine) const;
void EmitBranch(InsnIterator insn, SpirvRoutine *routine) const;
// OpcodeName returns the name of the opcode op. // OpcodeName returns the name of the opcode op.
// If NDEBUG is defined, then OpcodeName will only return the numerical code. // If NDEBUG is defined, then OpcodeName will only return the numerical code.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment