Fix jumping in Aarch64 compiler
This commit is contained in:
parent
580ae22a98
commit
0784e27a01
1 changed files with 3 additions and 1 deletions
|
|
@ -739,6 +739,7 @@ namespace pslang::jit::aarch64
|
||||||
void apply(ir::node_ref, ir::jump_if_zero const & node, types::type_ptr const &)
|
void apply(ir::node_ref, ir::jump_if_zero const & node, types::type_ptr const &)
|
||||||
{
|
{
|
||||||
load(node.condition, 0);
|
load(node.condition, 0);
|
||||||
|
extend(0, node.condition->inferred_type);
|
||||||
lcontext.cbranch_resolve.emplace_back(pcontext.code.size(), node.target);
|
lcontext.cbranch_resolve.emplace_back(pcontext.code.size(), node.target);
|
||||||
builder.cbz(0, 0);
|
builder.cbz(0, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -746,6 +747,7 @@ namespace pslang::jit::aarch64
|
||||||
void apply(ir::node_ref, ir::jump_if_nonzero const & node, types::type_ptr const &)
|
void apply(ir::node_ref, ir::jump_if_nonzero const & node, types::type_ptr const &)
|
||||||
{
|
{
|
||||||
load(node.condition, 0);
|
load(node.condition, 0);
|
||||||
|
extend(0, node.condition->inferred_type);
|
||||||
lcontext.cbranch_resolve.emplace_back(pcontext.code.size(), node.target);
|
lcontext.cbranch_resolve.emplace_back(pcontext.code.size(), node.target);
|
||||||
builder.cbnz(0, 0);
|
builder.cbnz(0, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -1054,7 +1056,7 @@ namespace pslang::jit::aarch64
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
{
|
{
|
||||||
// Uncomment to debug per-node instruction generation:
|
// Uncomment to debug per-node instruction generation:
|
||||||
builder.nop();
|
// builder.nop();
|
||||||
lcontext.nodes[it] = pcontext.code.size();
|
lcontext.nodes[it] = pcontext.code.size();
|
||||||
std::visit([&](auto const & instruction){ apply(it, instruction, it->inferred_type); }, it->instruction);
|
std::visit([&](auto const & instruction){ apply(it, instruction, it->inferred_type); }, it->instruction);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue