mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-12-23 00:35:38 +00:00
Add OpUnreachable
This commit is contained in:
parent
84fab90024
commit
f1cccfd0f3
|
@ -292,6 +292,9 @@ public:
|
||||||
/// Returns with no value from a function with void return type.
|
/// Returns with no value from a function with void return type.
|
||||||
void OpReturn();
|
void OpReturn();
|
||||||
|
|
||||||
|
/// Behavior is undefined if this instruction is executed.
|
||||||
|
void OpUnreachable();
|
||||||
|
|
||||||
/// Return a value from a function.
|
/// Return a value from a function.
|
||||||
Id OpReturnValue(Id value);
|
Id OpReturnValue(Id value);
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,11 @@ void Module::OpReturn() {
|
||||||
*code << spv::Op::OpReturn << EndOp{};
|
*code << spv::Op::OpReturn << EndOp{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::OpUnreachable() {
|
||||||
|
code->Reserve(1);
|
||||||
|
*code << spv::Op::OpUnreachable << EndOp{};
|
||||||
|
}
|
||||||
|
|
||||||
Id Module::OpReturnValue(Id value) {
|
Id Module::OpReturnValue(Id value) {
|
||||||
code->Reserve(2);
|
code->Reserve(2);
|
||||||
return *code << spv::Op::OpReturnValue << value << EndOp{};
|
return *code << spv::Op::OpReturnValue << value << EndOp{};
|
||||||
|
|
Loading…
Reference in a new issue