mirror of
https://git.suyu.dev/suyu/sirit.git
synced 2025-12-31 19:54:53 +01:00
Rename "insts" directory to "instructions"
This commit is contained in:
parent
f5944d61a6
commit
f259019494
15 changed files with 14 additions and 14 deletions
|
|
@ -1,62 +0,0 @@
|
|||
/* This file is part of the sirit project.
|
||||
* Copyright (c) 2018 ReinUsesLisp
|
||||
* This software may be used and distributed according to the terms of the GNU
|
||||
* Lesser General Public License version 3 or any later version.
|
||||
*/
|
||||
|
||||
#include "common_types.h"
|
||||
#include "op.h"
|
||||
#include "sirit/sirit.h"
|
||||
#include <vector>
|
||||
|
||||
namespace Sirit {
|
||||
|
||||
Id Module::OpLoopMerge(Id merge_block, Id continue_target,
|
||||
spv::LoopControlMask loop_control,
|
||||
const std::vector<Id>& literals) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpLoopMerge)};
|
||||
op->Add(merge_block);
|
||||
op->Add(continue_target);
|
||||
op->Add(static_cast<u32>(loop_control));
|
||||
op->Add(literals);
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
Id Module::OpSelectionMerge(Id merge_block,
|
||||
spv::SelectionControlMask selection_control) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpSelectionMerge)};
|
||||
op->Add(merge_block);
|
||||
op->Add(static_cast<u32>(selection_control));
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
Id Module::OpLabel() { return AddCode(spv::Op::OpLabel, bound++); }
|
||||
|
||||
Id Module::OpBranch(Id target_label) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpBranch)};
|
||||
op->Add(target_label);
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
Id Module::OpBranchConditional(Id condition, Id true_label, Id false_label,
|
||||
u32 true_weight, u32 false_weight) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpBranchConditional)};
|
||||
op->Add(condition);
|
||||
op->Add(true_label);
|
||||
op->Add(false_label);
|
||||
if (true_weight != 0 || false_weight != 0) {
|
||||
op->Add(true_weight);
|
||||
op->Add(false_weight);
|
||||
}
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
Id Module::OpReturn() { return AddCode(spv::Op::OpReturn); }
|
||||
|
||||
Id Module::OpReturnValue(Id value) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpReturnValue)};
|
||||
op->Add(value);
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
} // namespace Sirit
|
||||
Loading…
Add table
Add a link
Reference in a new issue