Fix extending register after logical not in aarch64 compiler
This commit is contained in:
parent
c8cd86dd0b
commit
7f574eabbd
3 changed files with 7 additions and 2 deletions
|
|
@ -182,8 +182,8 @@ int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
// TODO: remove, testing-only code; should execute entry point instead
|
// TODO: remove, testing-only code; should execute entry point instead
|
||||||
auto offset = pcontext.symbols.at("test");
|
auto offset = pcontext.symbols.at("test");
|
||||||
auto fptr = (double(*)(double))(executable.data.get() + offset);
|
auto fptr = (std::uint32_t(*)(std::uint32_t))(executable.data.get() + offset);
|
||||||
auto x = fptr(3.14159265358979323846 / 6.0);
|
auto x = fptr(0);
|
||||||
std::cout << "Result: " << std::boolalpha << x << std::endl;
|
std::cout << "Result: " << std::boolalpha << x << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,6 @@ func add_or_sub(add : bool) -> (u32 -> u32):
|
||||||
return add1
|
return add1
|
||||||
else:
|
else:
|
||||||
return sub1
|
return sub1
|
||||||
|
|
||||||
|
func test(x: u32) -> u32:
|
||||||
|
return (!0us) as u32
|
||||||
|
|
|
||||||
|
|
@ -404,6 +404,8 @@ namespace pslang::jit::aarch64
|
||||||
case ast::unary_operation_type::logical_not:
|
case ast::unary_operation_type::logical_not:
|
||||||
apply(*node.arg1);
|
apply(*node.arg1);
|
||||||
builder.or_not_reg(31, 0, 0);
|
builder.or_not_reg(31, 0, 0);
|
||||||
|
if (types::is_integer_type(*node.inferred_type))
|
||||||
|
extend(0, node.inferred_type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue