From e5b11fd707cbec05dfec6c8e4f24fc34321e9568 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 4 Jan 2026 13:52:53 +0300 Subject: [PATCH] Aarch64 jit compiler wip: support bool function arguments --- libs/jit/source/arch/aarch64/compiler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/jit/source/arch/aarch64/compiler.cpp b/libs/jit/source/arch/aarch64/compiler.cpp index 09eb3af..3cba181 100644 --- a/libs/jit/source/arch/aarch64/compiler.cpp +++ b/libs/jit/source/arch/aarch64/compiler.cpp @@ -1,3 +1,4 @@ +#include "pslang/types/type_fwd.hpp" #include #include #include @@ -409,7 +410,14 @@ namespace pslang::jit::aarch64 scopes.emplace_back(); 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); scopes.back().variables[node.arguments[i].name] = {.frame_offset = stack_offset}; }