Support casting pointers <-> u64
This commit is contained in:
parent
52a2a00d1f
commit
75f1cea3f3
2 changed files with 14 additions and 1 deletions
|
|
@ -535,6 +535,12 @@ namespace pslang::ast
|
|||
}
|
||||
}
|
||||
|
||||
if (types::equal(*source_type, types::primitive_type{types::u64_type{}}) && types::is_pointer_type(*target_type))
|
||||
return;
|
||||
|
||||
if (types::equal(*target_type, types::primitive_type{types::u64_type{}}) && types::is_pointer_type(*source_type))
|
||||
return;
|
||||
|
||||
if (auto source_array_type = std::get_if<types::array_type>(source_type.get()))
|
||||
{
|
||||
if (auto target_pointer_type = std::get_if<types::pointer_type>(target_type.get()))
|
||||
|
|
|
|||
|
|
@ -591,7 +591,14 @@ namespace pslang::jit::aarch64
|
|||
auto src_type = node.arg1->inferred_type;
|
||||
auto dst_type = node.target_type;
|
||||
|
||||
if (types::equal(*src_type, *dst_type) || (types::is_pointer_type(*src_type) && types::is_pointer_type(*dst_type)))
|
||||
auto u64_type = types::primitive_type{types::u64_type{}};
|
||||
|
||||
if (false
|
||||
|| (types::is_builtin_type(*src_type) && types::equal(*src_type, *dst_type))
|
||||
|| (types::is_pointer_type(*src_type) && types::is_pointer_type(*dst_type))
|
||||
|| (types::equal(*src_type, u64_type) && types::is_pointer_type(*dst_type))
|
||||
|| (types::equal(*dst_type, u64_type) && types::is_pointer_type(*src_type))
|
||||
)
|
||||
{
|
||||
load(node.arg1, 0);
|
||||
store(it, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue