Skip to content
Snippets Groups Projects

Misc. progress

Merged rarbore2 requested to merge cpu_vector_better into main
+ 29
5
@@ -622,9 +622,26 @@ impl<'a> RTContext<'a> {
} => {
let block = &mut blocks.get_mut(&bb).unwrap().data;
let collect_ty = self.typing[collect.idx()];
let out_size = self.codegen_type_size(self.typing[id.idx()]);
let self_ty = self.typing[id.idx()];
let offset = self.codegen_index_math(collect_ty, indices, bb)?;
todo!();
if self.module.types[self_ty.idx()].is_primitive() {
write!(
block,
"{} = ({}.byte_add({} as usize).0 as *mut {}).read();",
self.get_value(id, bb, true),
self.get_value(collect, bb, false),
offset,
self.get_type(self_ty)
)?;
} else {
write!(
block,
"{} = {}.byte_add({} as usize);",
self.get_value(id, bb, true),
self.get_value(collect, bb, false),
offset,
)?;
}
}
Node::Write {
collect,
@@ -633,11 +650,18 @@ impl<'a> RTContext<'a> {
} => {
let block = &mut blocks.get_mut(&bb).unwrap().data;
let collect_ty = self.typing[collect.idx()];
let data_size = self.codegen_type_size(self.typing[data.idx()]);
let offset = self.codegen_index_math(collect_ty, indices, bb)?;
let data_ty = self.typing[data.idx()];
let data_size = self.codegen_type_size(data_ty);
let offset = self.codegen_index_math(collect_ty, indices, bb)?;
if self.module.types[data_ty.idx()].is_primitive() {
todo!();
write!(
block,
"({}.byte_add({} as usize).0 as *mut {}).write({});",
self.get_value(collect, bb, false),
offset,
self.get_type(data_ty),
self.get_value(data, bb, false),
)?;
} else {
// If the data item being written is not a primitive type,
// then perform a memcpy from the data collection to the
Loading