This commit is contained in:
Folkert 2023-02-08 19:57:21 +01:00
parent f32d31341a
commit 8421824e31
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
3 changed files with 48 additions and 4 deletions

View File

@ -1518,7 +1518,42 @@ impl<
let dst_reg = storage_manager.claim_general_reg(buf, dst);
ASM::mov_reg64_mem64_offset32(buf, dst_reg, tmp, 0);
}
x => internal_error!("Loading list element with layout: {:?}", x),
single_register_floats!() => {
let dst_reg = storage_manager.claim_float_reg(buf, dst);
ASM::mov_freg64_freg64(buf, dst_reg, CC::FLOAT_RETURN_REGS[0]);
}
Layout::STR => {
let dst_reg = storage_manager.claim_general_reg(buf, dst);
let base_offset = storage_manager.claim_stack_area(dst, 24);
// move 1 into a register
ASM::mov_mem64_offset32_reg64(buf, dst_reg, 0, tmp);
ASM::mov_base32_reg64(buf, base_offset + 0, dst_reg);
// word 2
ASM::mov_mem64_offset32_reg64(buf, dst_reg, 8, tmp);
ASM::mov_base32_reg64(buf, base_offset + 8, dst_reg);
// word 3
ASM::mov_mem64_offset32_reg64(buf, dst_reg, 16, tmp);
ASM::mov_base32_reg64(buf, base_offset + 16, dst_reg);
}
other => {
//
match self.layout_interner.get(other) {
Layout::Boxed(_) => {
let dst_reg = storage_manager.claim_general_reg(buf, dst);
ASM::mov_reg64_reg64(buf, dst_reg, CC::GENERAL_RETURN_REGS[0]);
}
_ => {
todo!(
"cannot load {} from the heap yet",
self.layout_interner.dbg(other)
);
}
}
}
}
});
},
@ -1925,7 +1960,13 @@ impl<
tag_layouts[tag_id as usize],
);
}
x => todo!("loading from union type: {:?}", x),
_ => {
let union_in_layout = self.layout_interner.insert(Layout::Union(*union_layout));
todo!(
"loading from union type: {:?}",
self.layout_interner.dbg(union_in_layout)
)
}
}
}
@ -2004,7 +2045,9 @@ impl<
let dst_reg = self.storage_manager.claim_general_reg(&mut self.buf, &dst);
ASM::mov_reg64_mem64_offset32(&mut self.buf, dst_reg, ptr_reg, 0);
}
x => internal_error!("Loading list element with layout: {:?}", x),
_ => {
todo!("unboxing of {:?}", self.layout_interner.dbg(element_layout))
}
}
}

View File

@ -557,6 +557,7 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
// This should have been recieved via an arg pointer.
// That means the value is already loaded onto the stack area we allocated before the call.
// Nothing to do.
dbg!(sym);
}
}
}

View File

@ -76,7 +76,7 @@ fn str_split_bigger_delimiter_small_str() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_str_concat_repeated() {
assert_evals_to!(
indoc!(