Aarch64 jit compiler wip: support bool function arguments
This commit is contained in:
parent
f28138e5b9
commit
e5b11fd707
1 changed files with 9 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "pslang/types/type_fwd.hpp"
|
||||||
#include <pslang/jit/arch/aarch64/compiler.hpp>
|
#include <pslang/jit/arch/aarch64/compiler.hpp>
|
||||||
#include <pslang/jit/arch/aarch64/instruction_builder.hpp>
|
#include <pslang/jit/arch/aarch64/instruction_builder.hpp>
|
||||||
#include <pslang/jit/executable.hpp>
|
#include <pslang/jit/executable.hpp>
|
||||||
|
|
@ -409,7 +410,14 @@ namespace pslang::jit::aarch64
|
||||||
scopes.emplace_back();
|
scopes.emplace_back();
|
||||||
for (std::size_t i = 0; i < node.arguments.size(); ++i)
|
for (std::size_t i = 0; i < node.arguments.size(); ++i)
|
||||||
{
|
{
|
||||||
extend(i, ast::get_type(*node.arguments[i].type));
|
auto type = ast::get_type(*node.arguments[i].type);
|
||||||
|
if (types::is_bool_type(*type))
|
||||||
|
{
|
||||||
|
builder.tst(i, i);
|
||||||
|
builder.csetm(i, 0b0001);
|
||||||
|
}
|
||||||
|
else if (types::is_integer_type(*type))
|
||||||
|
extend(i, type);
|
||||||
push(i);
|
push(i);
|
||||||
scopes.back().variables[node.arguments[i].name] = {.frame_offset = stack_offset};
|
scopes.back().variables[node.arguments[i].name] = {.frame_offset = stack_offset};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue